GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Pull Request — master (#53)
by Alessandro
03:19
created

QueryBuilderFactoryTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testGetAvailableFilters() 0 56 1
1
<?php
2
3
namespace Mado\QueryBundle\Tests\Queries;
4
5
use Mado\QueryBundle\Queries\QueryBuilderFactory;
6
use PHPUnit\Framework\TestCase;
7
8
class QueryBuilderFactoryTest extends TestCase
9
{
10
    public function testGetAvailableFilters()
11
    {
12
        $entityManager = $this
13
            ->getMockBuilder('Doctrine\ORM\EntityManager')
14
            ->disableOriginalConstructor()
15
            ->getMock();
16
17
        $queryBuilderFactory = new QueryBuilderFactory($entityManager);
18
19
        $expectedFilters = [
20
            'eq' => [
21
                'meta' => '=',
22
            ],
23
            'neq' => [
24
                'meta' => '!=',
25
            ],
26
            'gt' => [
27
                'meta' => '>',
28
            ],
29
            'gte' => [
30
                'meta' => '>=',
31
            ],
32
            'lt' => [
33
                'meta' => '<',
34
            ],
35
            'lte' => [
36
                'meta' => '<=',
37
            ],
38
            'startswith' => [
39
                'meta' => 'LIKE',
40
                'substitution_pattern' => '{string}%'
41
            ],
42
            'contains' => [
43
                'meta' => 'LIKE',
44
                'substitution_pattern' => '%{string}%'
45
            ],
46
            'notcontains' => [
47
                'meta' => 'NOT LIKE',
48
                'substitution_pattern' => '%{string}%'
49
            ],
50
            'endswith' => [
51
                'meta' => 'LIKE',
52
                'substitution_pattern' => '%{string}'
53
            ],
54
            'list' => [
55
                'meta' => 'IN',
56
                'substitution_pattern' => '({string})',
57
            ],
58
            'field_eq' => [
59
                'meta' => '=',
60
            ],
61
        ];
62
63
        $availableFilters = $queryBuilderFactory->getValueAvailableFilters();
64
65
        $this->assertEquals($expectedFilters, $availableFilters);
66
    }
67
}