Failed Conditions
Push — master ( ab912b...01f77f )
by Adrien
10:12
created

AbstractRepositoryTest::assertAccountBalance()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
c 0
b 0
f 0
nc 1
nop 3
dl 0
loc 5
rs 10
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
/**
11
 * @group Repository
12
 */
13
abstract class AbstractRepositoryTest extends TestCase
14
{
15
    use TestWithTransactionAndUser;
16
17
    protected function assertAccountBalance(int $id, int $expected, string $message): void
18
    {
19
        $connection = $this->getEntityManager()->getConnection();
20
        $actual = $connection->fetchColumn('SELECT balance FROM account WHERE id = ' . $id);
21
        self::assertSame($expected, (int) $actual, $message);
22
    }
23
}
24