diff --git a/tests/DoctrineModuleTest/Stdlib/Hydrator/DoctrineObjectTest.php b/tests/DoctrineModuleTest/Stdlib/Hydrator/DoctrineObjectTest.php index f1edf19..cbfa8a1 100644 --- a/tests/DoctrineModuleTest/Stdlib/Hydrator/DoctrineObjectTest.php +++ b/tests/DoctrineModuleTest/Stdlib/Hydrator/DoctrineObjectTest.php @@ -2567,19 +2567,29 @@ public function testDefaultStrategy() $entity = new Asset\OneToManyEntity(); - $this->hydratorByValue->extract($entity); + $this->hydratorByValue->hydrate(array(), $entity); $this->assertEquals( 'DoctrineModule\Stdlib\Hydrator\Strategy\AllowRemoveByValue', $this->hydratorByValue->getDefaultByValueStrategy() ); - $this->hydratorByReference->extract($entity); + $this->assertInstanceOf( + 'DoctrineModule\Stdlib\Hydrator\Strategy\AllowRemoveByValue', + $this->hydratorByValue->getStrategy('entities') + ); + + $this->hydratorByReference->hydrate(array(), $entity); $this->assertEquals( 'DoctrineModule\Stdlib\Hydrator\Strategy\AllowRemoveByReference', $this->hydratorByReference->getDefaultByReferenceStrategy() ); + + $this->assertInstanceOf( + 'DoctrineModule\Stdlib\Hydrator\Strategy\AllowRemoveByReference', + $this->hydratorByReference->getStrategy('entities') + ); } /** @@ -2590,22 +2600,32 @@ public function testOverrideDefaultStrategy() $this->configureObjectManagerForOneToManyEntity(); $this->hydratorByValue->setDefaultByValueStrategy(__NAMESPACE__ . '\Asset\DifferentAllowRemoveByValue'); - $this->hydratorByReference->setDefaultByValueStrategy(__NAMESPACE__ . '\Asset\DifferentAllowRemoveByReference'); + $this->hydratorByReference->setDefaultByReferenceStrategy(__NAMESPACE__ . '\Asset\DifferentAllowRemoveByReference'); $entity = new Asset\OneToManyEntity(); - $this->hydratorByValue->extract($entity); + $this->hydratorByValue->hydrate(array(), $entity); $this->assertEquals( __NAMESPACE__ . '\Asset\DifferentAllowRemoveByValue', $this->hydratorByValue->getDefaultByValueStrategy() ); - $this->hydratorByReference->extract($entity); + $this->assertInstanceOf( + __NAMESPACE__ . '\Asset\DifferentAllowRemoveByValue', + $this->hydratorByValue->getStrategy('entities') + ); + + $this->hydratorByReference->hydrate(array(), $entity); $this->assertEquals( __NAMESPACE__ . '\Asset\DifferentAllowRemoveByReference', - $this->hydratorByReference->getDefaultByValueStrategy() + $this->hydratorByReference->getDefaultByReferenceStrategy() + ); + + $this->assertInstanceOf( + __NAMESPACE__ . '\Asset\DifferentAllowRemoveByReference', + $this->hydratorByReference->getStrategy('entities') ); } }