Failed Conditions
Pull Request — master (#187)
by Adrien
19:30 queued 16:44
created

AbstractRepository   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 9
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A assertAccountBalance() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ApplicationTest\Repository;
6
7
use ApplicationTest\Traits\TestWithTransactionAndUser;
8
use PHPUnit\Framework\TestCase;
9
10
abstract class AbstractRepository extends TestCase
11
{
12
    use TestWithTransactionAndUser;
13
14
    protected function assertAccountBalance(int $id, int $expected, string $message): void
15
    {
16
        $connection = $this->getEntityManager()->getConnection();
17
        $actual = $connection->fetchOne('SELECT balance FROM account WHERE id = ' . $id);
18
        self::assertSame($expected, (int) $actual, $message);
19
    }
20
}
21