Completed
Pull Request — master (#30)
by Quang
02:15
created

TypeResolverTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 5
rs 9.4285
1
<?php
2
3
use Digia\Lumen\GraphQL\Tests\TestCase;
4
use Digia\Lumen\GraphQL\Types\TypeResolver;
5
use Youshido\GraphQL\Config\Object\ObjectTypeConfig;
6
use Youshido\GraphQL\Type\Object\AbstractObjectType;
7
8
class TypeResolverTest extends TestCase
9
{
10
11
    public function setUp()
12
    {
13
        config([
14
            'graphql.types' => [
15
                'foo' => FooType::class,
16
            ],
17
        ]);
18
    }
19
20
    public function resolveTypeTest()
21
    {
22
        $className = TypeResolver::resolveType('foo');
0 ignored issues
show
Bug introduced by
'foo' of type string is incompatible with the type array expected by parameter $object of Digia\Lumen\GraphQL\Type...Resolver::resolveType(). ( Ignorable by Annotation )

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

22
        $className = TypeResolver::resolveType(/** @scrutinizer ignore-type */ 'foo');
Loading history...
23
24
        $this->assertEquals(FooType::class, $className);
25
    }
26
}
27
28
class FooType extends AbstractObjectType
29
{
30
31
    /**
32
     * @param ObjectTypeConfig $config
33
     */
34
    public function build($config)
35
    {
36
        // TODO: Implement build() method.
37
    }
38
}
39