Completed
Push — master ( 2197c6...b3e1ed )
by Adrien
07:42
created

InvoicerTest::testInvoice()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 8
nc 1
nop 0
dl 0
loc 14
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ApplicationTest\Service;
6
7
use Application\Model\User;
8
use Application\Service\Invoicer;
9
use ApplicationTest\Traits\TestWithTransaction;
10
use PHPUnit\Framework\TestCase;
11
12
class InvoicerTest extends TestCase
13
{
14
    use TestWithTransaction;
15
16
    public function testInvoice(): void
17
    {
18
        global $container;
19
20
        $user = _em()->getRepository(User::class)->getByLogin('administrator');
21
        User::setCurrent($user);
22
23
        /** @var Invoicer $invoicer */
24
        $invoicer = $container->get(Invoicer::class);
25
        $actual = $invoicer->invoice();
26
        self::assertSame(1, $actual);
27
28
        $actual2 = $invoicer->invoice();
29
        self::assertSame(0, $actual2);
30
    }
31
}
32