Completed
Pull Request — master (#36)
by Roman
04:41
created

PaginateStepTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 13
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testCanBeConstructed() 0 4 1
A testGetRequiredArtifacts() 0 4 1
1
<?php
2
3
namespace Kami\ApiCoreBundle\Tests\RequestProcessor\Step\Common;
4
5
use Doctrine\ORM\EntityManager;
6
use Doctrine\ORM\EntityManagerInterface;
7
use Doctrine\ORM\Query;
8
use Doctrine\ORM\QueryBuilder;
9
use Doctrine\ORM\Tools\Pagination\Paginator;
10
use Kami\ApiCoreBundle\RequestProcessor\ProcessorResponse;
0 ignored issues
show
Bug introduced by
The type Kami\ApiCoreBundle\Reque...essor\ProcessorResponse was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
use Kami\ApiCoreBundle\RequestProcessor\Step\Common\BuildSelectQueryStep;
12
use Kami\ApiCoreBundle\RequestProcessor\Step\Common\GetEntityFromReflectionStep;
13
use Kami\ApiCoreBundle\RequestProcessor\Step\Common\GetReflectionFromRequestStep;
14
use Kami\ApiCoreBundle\RequestProcessor\Step\Common\HandleRequestStep;
15
use Kami\ApiCoreBundle\RequestProcessor\Step\Common\PaginateStep;
16
use Kami\ApiCoreBundle\Tests\Entity\MyModel;
17
use Kami\ApiCoreBundle\Tests\fixtures\Entity;
18
use Kami\Component\RequestProcessor\Artifact;
19
use Kami\Component\RequestProcessor\ArtifactCollection;
20
use PHPUnit\Framework\TestCase;
21
use Symfony\Component\Form\Form;
22
use Symfony\Component\HttpFoundation\Request;
23
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
24
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
25
26
class PaginateStepTest extends TestCase
27
{
28
29
    public function testCanBeConstructed()
30
    {
31
        $step = new PaginateStep(10, 100);
32
        $this->assertInstanceOf(PaginateStep::class, $step);
33
    }
34
35
    public function testGetRequiredArtifacts()
36
    {
37
        $step = new PaginateStep(10, 100);
38
        $this->assertEquals(['query_builder', 'select_query_built', 'access_granted'], $step->getRequiredArtifacts());
39
    }
40
}
41