Completed
Pull Request — master (#9)
by Iakov
03:07
created

BuildSelectQueryStepTest::testCanBeConstructed()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Kami\ApiCoreBundle\Tests\RequestProcessor\Step\Common;
4
5
use Kami\ApiCoreBundle\RequestProcessor\Step\Common\BuildSelectQueryStep;
6
use Kami\ApiCoreBundle\RequestProcessor\Step\Common\GetQueryBuilderStep;
7
use Kami\ApiCoreBundle\Security\AccessManager;
8
use PHPUnit\Framework\TestCase;
9
10
class BuildSelectQueryStepTest extends TestCase
11
{
12
13
    public function testCanBeConstructed()
14
    {
15
        $accessManager = $this->createMock(AccessManager::class);
16
        $step = new BuildSelectQueryStep($accessManager);
0 ignored issues
show
Bug introduced by
The call to Kami\ApiCoreBundle\Reque...ueryStep::__construct() has too few arguments starting with reader. ( Ignorable by Annotation )

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

16
        $step = /** @scrutinizer ignore-call */ new BuildSelectQueryStep($accessManager);

This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
17
        $this->assertInstanceOf(BuildSelectQueryStep::class, $step);
18
    }
19
20
    public function testRequiresBefore()
21
    {
22
        $accessManager = $this->createMock(AccessManager::class);
23
        $step = new BuildSelectQueryStep($accessManager);
0 ignored issues
show
Bug introduced by
The call to Kami\ApiCoreBundle\Reque...ueryStep::__construct() has too few arguments starting with reader. ( Ignorable by Annotation )

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

23
        $step = /** @scrutinizer ignore-call */ new BuildSelectQueryStep($accessManager);

This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
24
        $this->assertEquals([GetQueryBuilderStep::class], $step->requiresBefore());
25
    }
26
27
    public function testExecute()
28
    {
29
30
    }
31
}
32