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