diff --git a/tests/Doctrine/Tests/ORM/Mapping/ReflectionEmbeddedPropertyTest.php b/tests/Doctrine/Tests/ORM/Mapping/ReflectionEmbeddedPropertyTest.php index 237de15d8..8a67efdf3 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/ReflectionEmbeddedPropertyTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/ReflectionEmbeddedPropertyTest.php @@ -42,6 +42,30 @@ class ReflectionEmbeddedPropertyTest extends \PHPUnit_Framework_TestCase $this->assertSame('changedValue', $embeddedPropertyReflection->getValue($object)); } + /** + * @param ReflectionProperty $parentProperty + * @param ReflectionProperty $childProperty + * + * @dataProvider getTestedReflectionProperties + */ + public function testWillSkipReadingPropertiesFromNullEmbeddable( + ReflectionProperty $parentProperty, + ReflectionProperty $childProperty + ) + { + $embeddedPropertyReflection = new ReflectionEmbeddedProperty( + $parentProperty, + $childProperty, + $childProperty->getDeclaringClass()->getName() + ); + + $instantiator = new Instantiator(); + + $this->assertNull($embeddedPropertyReflection->getValue( + $instantiator->instantiate($parentProperty->getDeclaringClass()->getName()) + )); + } + /** * Data provider *