Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
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
8declare(strict_types=1);
9
10use AppDemo\Library\Infrastructure\SqliteBookRepository;
11use Phexium\Plugin\IdGenerator\Adapter\TimestampIdGenerator;
12use Phexium\Plugin\SqlDriver\Adapter\SqliteDriver;
13use Tests\Phexium\Integration\Support\PdoRegistry;
14
15// @codeCoverageIgnoreStart
16require_once __DIR__.'/BaseBookRepositoryTests.php';
17registerBaseBookRepositoryTests();
18
19$dbName = null;
20beforeAll(function () use (&$dbName): void {
21    $dbName = PdoRegistry::initializeSqlite(true);
22});
23afterAll(function (): void {
24    PdoRegistry::cleanupSqlite();
25});
26// @codeCoverageIgnoreEnd
27
28beforeEach(function (): void {
29    PdoRegistry::getConnection()->beginTransaction();
30    $driver = new SqliteDriver(PdoRegistry::getConnection());
31    $this->repository = new SqliteBookRepository($driver, new TimestampIdGenerator());
32});
33
34afterEach(function (): void {
35    PdoRegistry::getConnection()->rollBack();
36});