Passed
Pull Request — master (#25)
by David
01:57
created

GlobTypeMapperTest::testGlobTypeMapper()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 12
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace TheCodingMachine\GraphQL\Controllers\Mappers;
4
5
use Doctrine\Common\Annotations\AnnotationReader;
6
use Mouf\Picotainer\Picotainer;
7
use PHPUnit\Framework\TestCase;
8
use Symfony\Component\Cache\Simple\NullCache;
9
use TheCodingMachine\GraphQL\Controllers\AbstractQueryProviderTest;
10
use TheCodingMachine\GraphQL\Controllers\Fixtures\TestType;
11
12
class GlobTypeMapperTest extends AbstractQueryProviderTest
13
{
14
    public function testGlobTypeMapper()
15
    {
16
        $container = new Picotainer([
17
            TestType::class => function() {
18
                return new TestType($this->getRegistry());
19
            }
20
        ]);
21
22
        $mapper = new GlobTypeMapper('TheCodingMachine\GraphQL\Controllers\Fixtures', $container, new AnnotationReader(), new NullCache());
23
24
        $this->assertTrue($mapper->canMapClassToType(TestType::class));
25
        $this->assertInstanceOf(TestType::class, $mapper->mapClassToType(TestType::class));
26
    }
27
}
28