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

testGetRequiredArtifacts()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Kami\ApiCoreBundle\Tests\RequestProcessor\Step\Common;
4
5
use Kami\ApiCoreBundle\RequestProcessor\Step\Common\GetReflectionFromRequestStep;
6
use Kami\ApiCoreBundle\Tests\fixtures\Entity;
7
use Kami\Component\RequestProcessor\ArtifactCollection;
8
use PHPUnit\Framework\TestCase;
9
use Symfony\Component\HttpFoundation\ParameterBag;
10
use Symfony\Component\HttpFoundation\Request;
11
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
12
13
class GetReflectionFromRequestStepTest extends TestCase
14
{
15
16
    public function testExecute()
17
    {
18
        $request = new Request();
19
        $request->attributes->set('_entity', Entity::class);
20
        $step = new GetReflectionFromRequestStep();
21
22
        $artifacts = $step->execute($request);
23
        $this->assertInstanceOf(ArtifactCollection::class, $artifacts);
24
        $this->assertInstanceOf(\ReflectionClass::class, $artifacts->get('reflection')->getValue());
25
    }
26
27
    public function testGetRequiredArtifacts()
28
    {
29
        $step = new GetReflectionFromRequestStep();
30
31
        $this->assertEquals([], $step->getRequiredArtifacts());
32
    }
33
}
34