Conditions | 1 |
Paths | 1 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
17 | public function wrappedEntityManagerIsOnlyRecreatedWhenCurrentOneIsClosed( |
||
18 | EntityManagerInterface $wrapped, |
||
19 | bool $shouldRecreate |
||
20 | ): void { |
||
21 | $factoryCalls = 0; |
||
22 | $reopeningEm = new ReopeningEntityManager(static function () use ($wrapped, &$factoryCalls) { |
||
23 | $factoryCalls++; |
||
24 | return $wrapped; |
||
25 | }); |
||
26 | |||
27 | $reopeningEm->open(); |
||
28 | |||
29 | $this->assertEquals($shouldRecreate, $factoryCalls === 2); |
||
30 | } |
||
45 |