Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
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
8declare(strict_types=1);
9
10use AppDemo\Library\Infrastructure\InMemoryBookRepository;
11use AppDemo\Loan\Infrastructure\InMemoryLoanRepository;
12use AppDemo\User\Infrastructure\InMemoryUserRepository;
13use Phexium\Plugin\Clock\Adapter\SystemClock;
14use Phexium\Plugin\IdGenerator\Adapter\TimestampIdGenerator;
15use Phexium\Plugin\SqlDriver\Adapter\InMemoryDriver;
16
17// @codeCoverageIgnoreStart
18require_once __DIR__.'/BaseLoanRepositoryTests.php';
19registerBaseLoanRepositoryTests();
20// @codeCoverageIgnoreEnd
21
22beforeEach(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});