public function testPopulateWithClonesMethodCopiesPropertyValuesFromGivenTypeDefinition() { /** @var AbstractTypeDefinition|\PHPUnit_Framework_MockObject_MockObject $dummyTypeDefinition */ $dummyTypeDefinition = $this->getMockBuilder('\\Dkd\\PhpCmis\\DataObjects\\AbstractTypeDefinition')->setConstructorArgs(array('typeId'))->getMockForAbstractClass(); foreach ($this->stringProperties as $stringProperty) { $setterName = 'set' . ucfirst($stringProperty); $dummyTypeDefinition->{$setterName}('dummyStringValue'); } foreach ($this->booleanProperties as $booleanProperty) { $setterName = 'set' . ucfirst($booleanProperty); $dummyTypeDefinition->{$setterName}(true); } foreach ($this->objectPropertyDataProvider() as $objectProperty) { $setterName = 'set' . ucfirst($objectProperty[0]); $dummyTypeDefinition->{$setterName}($objectProperty[1]); } $this->abstractTypeDefinition->populateWithClones($dummyTypeDefinition); $this->assertEquals($dummyTypeDefinition, $this->abstractTypeDefinition); }
/** * Object constructor sets defaults * * @param string $id The type definition id */ public function __construct($id) { parent::__construct($id); $this->contentStreamAllowed = ContentStreamAllowed::cast(ContentStreamAllowed::NOTALLOWED); }