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

AnnotatedObjectTypeTest::testBuild()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 0
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