Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
15 / 15 |
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\InMemoryBookRepository; |
| 11 | use AppDemo\Loan\Infrastructure\InMemoryLoanRepository; |
| 12 | use AppDemo\User\Infrastructure\InMemoryUserRepository; |
| 13 | use Phexium\Plugin\Clock\Adapter\SystemClock; |
| 14 | use Phexium\Plugin\IdGenerator\Adapter\TimestampIdGenerator; |
| 15 | use Phexium\Plugin\SqlDriver\Adapter\InMemoryDriver; |
| 16 | |
| 17 | // @codeCoverageIgnoreStart |
| 18 | require_once __DIR__.'/BaseLoanRepositoryTests.php'; |
| 19 | registerBaseLoanRepositoryTests(); |
| 20 | // @codeCoverageIgnoreEnd |
| 21 | |
| 22 | beforeEach(function (): void { |
| 23 | $idGenerator = new TimestampIdGenerator(); |
| 24 | $bookDriver = new InMemoryDriver(); |
| 25 | $userDriver = new InMemoryDriver(); |
| 26 | $loanDriver = new InMemoryDriver(); |
| 27 | $this->bookRepository = new InMemoryBookRepository($bookDriver, $idGenerator); |
| 28 | $this->userRepository = new InMemoryUserRepository($userDriver, $idGenerator); |
| 29 | $this->repository = new InMemoryLoanRepository( |
| 30 | $loanDriver, |
| 31 | $idGenerator, |
| 32 | $this->bookRepository, |
| 33 | $this->userRepository, |
| 34 | new SystemClock() |
| 35 | ); |
| 36 | }); |