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

GlobTypeMapperTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 7
dl 0
loc 14
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testGlobTypeMapper() 0 12 1
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