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