Failed Conditions
Push — master ( 977552...4856db )
by Adrien
12:24
created

LatestModificationTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 19
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A tearDown() 0 3 1
A testSorting() 0 12 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ApplicationTest\Api\Input\Sorting;
6
7
use Application\Model\ExpenseClaim;
8
use Application\Model\User;
9
10
class LatestModificationTest extends AbstractSorting
11
{
12
    public function tearDown(): void
13
    {
14
        User::setCurrent(null);
15
    }
16
17
    public function testSorting(): void
18
    {
19
        /** @var User $user */
20
        $user = _em()->getRepository(User::class)->getByLogin('member');
21
        User::setCurrent($user);
22
23
        $result = $this->getSortedQueryResult(ExpenseClaim::class, 'latestModification');
24
        self::assertSame([
25
            7002,
26
            7001,
27
            7000,
28
        ], $result);
29
    }
30
}
31