/**
* It should throw an exception if the property is required but the value is null.
*
* @expectedException Sulu\Component\Content\Exception\MandatoryPropertyException
*/
public function testThrowExceptionPropertyRequired()
{
$document = new TestContentDocument($this->structure->reveal());
$document->setStructureType('foobar');
$this->persistEvent->getDocument()->willReturn($document);
// map the structure type
$this->persistEvent->getLocale()->willReturn('fr');
// map the content
$this->inspector->getStructureMetadata($document)->willReturn($this->structureMetadata->reveal());
$this->inspector->getWebspace($document)->willReturn('webspace');
$this->structureMetadata->getProperties()->willReturn(['prop1' => $this->structureProperty->reveal()]);
$this->structureProperty->isRequired()->willReturn(true);
$this->structure->getProperty('prop1')->willReturn($this->propertyValue->reveal());
$this->propertyValue->getValue()->willReturn(null);
$this->structureMetadata->getName()->willReturn('test');
$this->structureMetadata->getResource()->willReturn('/path/to/resource.xml');
$this->subscriber->handlePersist($this->persistEvent->reveal());
}