Failed Conditions
Push — master ( 3b5f31...7e5acf )
by Adrien
16:34
created

AgeTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A tearDown() 0 3 1
A testSorting() 0 23 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ApplicationTest\Api\Input\Sorting;
6
7
use Application\Model\User;
8
use Ecodev\Felix\Testing\Api\Input\Sorting\AbstractSorting;
9
10
class AgeTest extends AbstractSorting
11
{
12
    protected function tearDown(): void
13
    {
14
        User::setCurrent(null);
15
    }
16
17
    public function testSorting(): void
18
    {
19
        $administrator = new User(User::ROLE_ADMINISTRATOR);
20
        User::setCurrent($administrator);
21
        $result = $this->getSortedQueryResult(_types(), User::class, 'age');
22
        self::assertSame([
23
            1004,
24
            1002,
25
            1012,
26
            1013,
27
            1014,
28
            1015,
29
            1010,
30
            1000,
31
            1007,
32
            1001,
33
            1005,
34
            1006,
35
            1008,
36
            1009,
37
            1003,
38
            1011,
39
        ], $result);
40
    }
41
}
42