Passed
Pull Request — master (#9)
by Alex
02:46
created

InnerJoinTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 23
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A assertFilterJoin() 0 11 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ArpTest\DoctrineQueryFilter\Filter;
6
7
use Arp\DoctrineQueryFilter\Enum\JoinConditionType;
8
use Arp\DoctrineQueryFilter\Filter\InnerJoin;
9
use Arp\DoctrineQueryFilter\QueryBuilderInterface;
10
use Doctrine\ORM\Query\Expr\Base;
11
use Doctrine\ORM\Query\Expr\Composite;
12
use PHPUnit\Framework\MockObject\MockObject;
13
14
/**
15
 * @covers \Arp\DoctrineQueryFilter\Filter\InnerJoin
16
 * @covers \Arp\DoctrineQueryFilter\Filter\AbstractJoin
17
 * @covers \Arp\DoctrineQueryFilter\Filter\AbstractFilter
18
 */
19
final class InnerJoinTest extends AbstractJoinTest
20
{
21
    protected string $filterClassName = InnerJoin::class;
22
23
    /**
24
     * @param QueryBuilderInterface&MockObject $queryBuilder
25
     * @param string $fieldName
26
     * @param string $alias
27
     * @param null|string|Composite|Base $joinCondition
28
     * @param JoinConditionType|null $joinConditionType
29
     * @param string|null $indexBy
30
     */
31
    protected function assertFilterJoin(
32
        QueryBuilderInterface $queryBuilder,
33
        string $fieldName,
34
        string $alias,
35
        null|string|Composite|Base $joinCondition = null,
36
        ?JoinConditionType $joinConditionType = null,
37
        ?string $indexBy = null
38
    ): void {
39
        $queryBuilder->expects($this->once())
0 ignored issues
show
Bug introduced by
The method expects() does not exist on Arp\DoctrineQueryFilter\QueryBuilderInterface. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

39
        $queryBuilder->/** @scrutinizer ignore-call */ 
40
                       expects($this->once())

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
40
            ->method('innerJoin')
41
            ->with($fieldName, $alias, $joinConditionType, $joinCondition, $indexBy);
42
    }
43
}
44