Skip to content

Commit

Permalink
Fixup GH8127 test case (doctrine#10424)
Browse files Browse the repository at this point in the history
* Fixup GH8127 test case

This removes the unnecessary "middle2" class and puts back in the effect of the data provider.

Both changes were accidentally committed when I was working on doctrine#10411 and just meant as experiments during debugging.

* Fix CS
  • Loading branch information
mpdude authored Jan 18, 2023
1 parent a83e4f7 commit ba7387f
Showing 1 changed file with 6 additions and 22 deletions.
28 changes: 6 additions & 22 deletions tests/Doctrine/Tests/ORM/Functional/Ticket/GH8127Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ protected function setUp(): void
$this->createSchemaForModels(
GH8127Root::class,
GH8127Middle::class,
GH8127Middle2::class,
GH8127Leaf::class
);
}
Expand All @@ -26,21 +25,19 @@ protected function setUp(): void
*/
public function testLoadFieldsFromAllClassesInHierarchy(string $queryClass): void
{
$entity = new GH8127Leaf();
$entity->root = 'root';
$entity->middle = 'middle';
$entity->middle2 = 'middle2';
$entity->leaf = 'leaf';
$entity = new GH8127Leaf();
$entity->root = 'root';
$entity->middle = 'middle';
$entity->leaf = 'leaf';

$this->_em->persist($entity);
$this->_em->flush();
$this->_em->clear();

$loadedEntity = $this->_em->find(GH8127Root::class, $entity->id);
$loadedEntity = $this->_em->find($queryClass, $entity->id);

self::assertSame('root', $loadedEntity->root);
self::assertSame('middle', $loadedEntity->middle);
self::assertSame('middle2', $loadedEntity->middle2);
self::assertSame('leaf', $loadedEntity->leaf);
}

Expand Down Expand Up @@ -94,20 +91,7 @@ abstract class GH8127Middle extends GH8127Root
/**
* @ORM\Entity
*/
abstract class GH8127Middle2 extends GH8127Middle
{
/**
* @ORM\Column
*
* @var string
*/
public $middle2;
}

/**
* @ORM\Entity
*/
class GH8127Leaf extends GH8127Middle2
class GH8127Leaf extends GH8127Middle
{
/**
* @ORM\Column
Expand Down

0 comments on commit ba7387f

Please sign in to comment.