Completed
Pull Request — master (#19)
by David
13:03
created

AnnotatedObjectTypeTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 3
dl 0
loc 13
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testBuild() 0 10 1
1
<?php
2
3
4
namespace TheCodingMachine\GraphQL\Controllers;
5
6
7
use TheCodingMachine\GraphQL\Controllers\Fixtures\TestObject;
8
use TheCodingMachine\GraphQL\Controllers\Fixtures\TestType;
9
use Youshido\GraphQL\Execution\ResolveInfo;
10
11
class AnnotatedObjectTypeTest extends AbstractQueryProviderTest
12
{
13
    public function testBuild()
14
    {
15
        $type = new TestType($this->getRegistry());
16
        $obj = new TestObject('bar');
17
        $mockResolveInfo = $this->createMock(ResolveInfo::class);
18
19
        $result = $type->getField('customField')->resolve($obj, ['param' => 'foo'], $mockResolveInfo);
20
21
        $this->assertSame('barfoo', $result);
22
    }
23
}
24