Test Failed
Pull Request — master (#4)
by Alex
03:18
created

IsMemberOfTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 9
c 2
b 0
f 0
dl 0
loc 40
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getExpressionString() 0 3 1
A getFilterWillApplyFilteringData() 0 8 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ArpTest\DoctrineQueryFilter\Filter;
6
7
use Arp\DoctrineQueryFilter\Filter\IsMemberOf;
8
9
/**
10
 * @covers \Arp\DoctrineQueryFilter\Filter\IsMemberOf
11
 * @covers \Arp\DoctrineQueryFilter\Filter\AbstractExpression
12
 * @covers \Arp\DoctrineQueryFilter\Filter\AbstractFilter
13
 *
14
 * @author  Alex Patterson <[email protected]>
15
 * @package ArpTest\DoctrineQueryFilter\Filter
16
 */
17
final class IsMemberOfTest extends AbstractComparisonTest
18
{
19
    /**
20
     * @var string
21
     */
22
    protected string $filterClassName = IsMemberOf::class;
23
24
    /**
25
     * @var string
26
     */
27
    protected string $expressionMethodName = 'isMemberOf';
28
29
    /**
30
     * @var string
31
     */
32
    protected string $expressionSymbol = 'MEMBER OF';
33
34
    /**
35
     * @param string      $fieldName
36
     * @param string|null $alias
37
     * @param array       $criteria
38
     *
39
     * @return string
40
     */
41
    protected function getExpressionString(string $fieldName, ?string $alias, array $criteria): string
42
    {
43
        return ':param_name ' . $this->expressionSymbol . $alias . '.' . $fieldName;
44
    }
45
46
    /**
47
     * @return array
48
     */
49
    public function getFilterWillApplyFilteringData(): array
50
    {
51
        return [
52
            [
53
                [
54
                    'name' => 'test',
55
                    'field' => 'hello',
56
                    'value' => 123,
57
                ],
58
            ],
59
        ];
60
    }
61
}
62