Skip to content

Commit b2d0c21

Browse files
committed
Workaround the impossibility of unsetting metadata
1 parent 7391e25 commit b2d0c21

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/Doctrine/Tests/ORM/Functional/Ticket/GH7512Test.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ protected function setUp(): void
3535

3636
public function testFindEntityByAssociationPropertyJoinedChildWithClearMetadata(): void
3737
{
38-
// unset metadata for entity B as though it hasn't been touched yet in application lifecycle.
39-
$this->_em->getMetadataFactory()->setMetadataFor(GH7512EntityB::class, null);
40-
$result = $this->_em->getRepository(GH7512EntityC::class)->findBy([
38+
// pretend we are starting afresh
39+
$this->_em = $this->getEntityManager();
40+
$result = $this->_em->getRepository(GH7512EntityC::class)->findBy([
4141
'entityA' => new GH7512EntityB(),
4242
]);
4343
$this->assertEmpty($result);

0 commit comments

Comments
 (0)