Passed
Pull Request — master (#9)
by Alex
02:41
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
 */
17
final class InnerJoinTest extends AbstractJoinTest
18
{
19
    protected string $filterClassName = InnerJoin::class;
20
21
    /**
22
     * @param QueryBuilderInterface&MockObject $queryBuilder
23
     * @param string $fieldName
24
     * @param string $alias
25
     * @param null|string|Composite|Base $joinCondition
26
     * @param JoinConditionType|null $joinConditionType
27
     * @param string|null $indexBy
28
     */
29
    protected function assertFilterJoin(
30
        QueryBuilderInterface $queryBuilder,
31
        string $fieldName,
32
        string $alias,
33
        null|string|Composite|Base $joinCondition = null,
34
        ?JoinConditionType $joinConditionType = null,
35
        ?string $indexBy = null
36
    ): void {
37
        $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

37
        $queryBuilder->/** @scrutinizer ignore-call */ 
38
                       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...
38
            ->method('innerJoin')
39
            ->with($fieldName, $alias, $joinConditionType, $joinCondition, $indexBy);
40
    }
41
}
42