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