Skip to content

Commit

Permalink
Fix tests for enum ID hydration (#9658)
Browse files Browse the repository at this point in the history
  • Loading branch information
michnovka authored Apr 13, 2022
1 parent f7fe5ad commit 7e49c70
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ public function testFlattenIdentifierWithEnumId(): void

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

$findTypedCardEnumIdEntityNotFound = $this->_em->getRepository(TypedCardEnumId::class)->find(Suit::Diamonds);

self::assertNull($findTypedCardEnumIdEntityNotFound, 'Search by non-cached Enum ID does not work');
self::assertNull($findTypedCardEnumIdEntityNotFound, 'Search by non-persisted Enum ID does not work');

$findTypedCardEnumIdEntity = $this->_em->getRepository(TypedCardEnumId::class)->find(Suit::Clubs);

Expand All @@ -73,10 +74,11 @@ public function testFlattenIdentifierWithCompositeEnumId(): void

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

$findTypedCardEnumCompositeIdEntityNotFound = $this->_em->getRepository(TypedCardEnumCompositeId::class)->find(['suit' => Suit::Diamonds, 'unit' => Unit::Gram]);

self::assertNull($findTypedCardEnumCompositeIdEntityNotFound, 'Search by non-cached composite Enum ID does not work');
self::assertNull($findTypedCardEnumCompositeIdEntityNotFound, 'Search by non-persisted composite Enum ID does not work');

$findTypedCardEnumCompositeIdEntity = $this->_em->getRepository(TypedCardEnumCompositeId::class)->find(['suit' => Suit::Clubs, 'unit' => Unit::Gram]);

Expand Down

0 comments on commit 7e49c70

Please sign in to comment.