diff --git a/src/TableInheritance.php b/src/TableInheritance.php index 176a36f2..3152c15f 100644 --- a/src/TableInheritance.php +++ b/src/TableInheritance.php @@ -66,7 +66,11 @@ public function run(Registry $registry): Registry // All child should be presented in a schema as separated entity // Every child will be handled according its table inheritance type - \assert($child->getRole() !== null && $entity !== null && isset($parent)); + // todo should $parent be not null? + // \assert(isset($parent)); + + \assert($child->getRole() !== null && $entity !== null); + if (!$registry->hasEntity($child->getRole())) { $registry->register($child); diff --git a/tests/Annotated/Fixtures/Fixtures16/ExecutiveProxy.php b/tests/Annotated/Fixtures/Fixtures16/ExecutiveProxy.php index c4d6356b..9676afb9 100644 --- a/tests/Annotated/Fixtures/Fixtures16/ExecutiveProxy.php +++ b/tests/Annotated/Fixtures/Fixtures16/ExecutiveProxy.php @@ -10,8 +10,7 @@ /** * This proxy class doesn't have an {@see Entity} annotation (attribute) declaration, * and it shouldn't be presented in Schema. - * Note: this behavior might be improved. There will be added support for - * annotated base class columns without Entity annotation declaration. + * But all the classes that extend this class should contain all the fields from this class. */ class ExecutiveProxy extends Employee { diff --git a/tests/Annotated/Functional/Driver/Common/BaseTestCase.php b/tests/Annotated/Functional/Driver/Common/BaseTestCase.php index 54f3a2c6..05fbcda0 100644 --- a/tests/Annotated/Functional/Driver/Common/BaseTestCase.php +++ b/tests/Annotated/Functional/Driver/Common/BaseTestCase.php @@ -115,14 +115,14 @@ public function getDriver(): Driver public static function singularReadersProvider(): \Traversable { - yield ['reader' => new AnnotationReader()]; - yield ['reader' => new AttributeReader()]; + yield ['Annotation reader' => new AnnotationReader()]; + yield ['Attribute reader' => new AttributeReader()]; } public static function allReadersProvider(): \Traversable { yield from static::singularReadersProvider(); - yield ['reader' => new SelectiveReader([new AttributeReader(), new AnnotationReader()])]; + yield ['Selective reader' => new SelectiveReader([new AttributeReader(), new AnnotationReader()])]; } protected function getDatabase(): Database diff --git a/tests/Annotated/Functional/Driver/Common/Inheritance/JoinedTableTestCase.php b/tests/Annotated/Functional/Driver/Common/Inheritance/JoinedTableTestCase.php index 52ec0e69..64d32f53 100644 --- a/tests/Annotated/Functional/Driver/Common/Inheritance/JoinedTableTestCase.php +++ b/tests/Annotated/Functional/Driver/Common/Inheritance/JoinedTableTestCase.php @@ -125,7 +125,7 @@ public function testTableInheritance(ReaderInterface $reader): void $this->assertSame('secret', $loadedExecutive->hidden); $this->assertSame(15000, $loadedExecutive->bonus); $this->assertSame('executive', $loadedExecutive->getType()); - $this->assertNull($loadedExecutive->proxyFieldWithAnnotation); + $this->assertSame('value', $loadedExecutive->proxyFieldWithAnnotation); } #[DataProvider('allReadersProvider')]