public function provideObjectGraph() { $objectA = new ObjectA(); $objectB = new ObjectB(); $objectC = new ObjectB(); $testA = new SubObject(); $testA->setFullname('HansImWald'); $testA->setIgnored(false); $objectA->setId(1); $objectA->setName('Jan'); $objectA->setStreet('blubb'); $objectA->setBool(true); $objectB->setId(1111); $objectB->setFullname('Jhon'); $objectB->setIgnored(false); $objectC->setId(13); $objectC->setFullname('Jhan2'); $objectC->setIgnored(true); $coll = new ArrayCollection(); $coll->add($objectB); $coll->add($objectC); $objectA->setFriends($coll); $objectA->setObj($testA); $objectAA = new ObjectA(); $objectBB = new ObjectB(); $objectCC = new ObjectB(); $testAA = new SubObject(); $testAA->setFullname('ReinerImWald'); $testAA->setIgnored(true); $objectAA->setId(1); $objectAA->setName('Jan22'); $objectAA->setStreet('blabb'); $objectAA->setBool(false); $objectBB->setId(12); $objectBB->setFullname('Jhon2'); $objectBB->setIgnored(true); $objectCC->setId(13); $objectCC->setFullname('Jhan'); $objectCC->setIgnored(false); $coll2 = new ArrayCollection(); $coll2->add($objectBB); $coll2->add($objectCC); $objectAA->setFriends($coll2); $objectAA->setObj($testAA); return array(array($objectA, $objectAA)); }
/** * @dataProvider provideFlatObject */ public function testFirstLevelNoPropertyMerge(SubObject $objectA, SubObject $objectAA) { $this->assertNotEquals($objectA->getNotMergeable(), $objectAA->getNotMergeable()); $this->objectMerger->merge($objectA, $objectAA); $this->assertNotEquals($objectA->getNotMergeable(), $objectAA->getNotMergeable()); }