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

InvoicerTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testInvoice() 0 14 1
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