Skip to content

Commit

Permalink
doctrine#10868 Fixed getting order from entity manager after it was c…
Browse files Browse the repository at this point in the history
…leared.
  • Loading branch information
tasselchof committed Aug 5, 2023
1 parent 54bb42e commit 1a6d48a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/Doctrine/Tests/ORM/Functional/Ticket/GH10868Test_2.php
Expand Up @@ -42,16 +42,18 @@ public function testReferenceAndLazyLoadProxyAreTheSame(): void
$this->_em->flush();
$this->_em->clear();

$order->orderProducts->count();
$order = $this->_em->getRepository(GH10868Order::class)->find($order->id);

$orderProductFromOrder = $order->orderProducts->first();

$orderProductOffer = $orderProductFromOrder->productOffer;

$reference = $this->_em->getReference(GH10868Offer::class, [
'shop' => $shop->id,
'id' => $offer->id,
]);

$orderProductFromOrder = $order->orderProducts->first();

self::assertSame($reference, $orderProductFromOrder->productOffer);
self::assertSame($reference, $orderProductOffer);
}
}

Expand Down

0 comments on commit 1a6d48a

Please sign in to comment.