Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
8 / 8 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
||
| 1 | <?php |
| 2 | |
| 3 | // ╔════════════════════════════════════════════════════════════╗ |
| 4 | // ║ MIT Licence (#Expat) - https://opensource.org/licenses/MIT ║ |
| 5 | // ║ Copyright 2026 Frederic Poeydomenge <dyno@phexium.com> ║ |
| 6 | // ╚════════════════════════════════════════════════════════════╝ |
| 7 | |
| 8 | declare(strict_types=1); |
| 9 | |
| 10 | use AppDemo\Library\Infrastructure\PostgresqlBookRepository; |
| 11 | use Phexium\Plugin\IdGenerator\Adapter\TimestampIdGenerator; |
| 12 | use Phexium\Plugin\SqlDriver\Adapter\PostgresqlDriver; |
| 13 | use Tests\Phexium\Integration\Support\PdoRegistry; |
| 14 | |
| 15 | // @codeCoverageIgnoreStart |
| 16 | require_once __DIR__.'/BaseBookRepositoryTests.php'; |
| 17 | registerBaseBookRepositoryTests(); |
| 18 | |
| 19 | $dbName = null; |
| 20 | beforeAll(function () use (&$dbName): void { |
| 21 | $dbName = PdoRegistry::initializePostgresql(true); |
| 22 | }); |
| 23 | afterAll(function () use (&$dbName): void { |
| 24 | PdoRegistry::cleanupPostgresql($dbName); |
| 25 | }); |
| 26 | // @codeCoverageIgnoreEnd |
| 27 | |
| 28 | beforeEach(function (): void { |
| 29 | PdoRegistry::getConnection()->beginTransaction(); |
| 30 | $driver = new PostgresqlDriver(PdoRegistry::getConnection()); |
| 31 | $this->repository = new PostgresqlBookRepository($driver, new TimestampIdGenerator()); |
| 32 | }); |
| 33 | |
| 34 | afterEach(function (): void { |
| 35 | PdoRegistry::getConnection()->rollBack(); |
| 36 | }); |