ResolveInfoTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 8

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 8
dl 0
loc 16
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testMethods() 0 13 1
1
<?php
2
/*
3
* This file is a part of GraphQL project.
4
*
5
* @author Alexandr Viniychuk <[email protected]>
6
* created: 5/19/16 1:28 PM
7
*/
8
9
namespace Youshido\Tests\Schema;
10
11
12
use Youshido\GraphQL\Execution\Context\ExecutionContext;
13
use Youshido\GraphQL\Execution\ResolveInfo;
14
use Youshido\GraphQL\Field\Field;
15
use Youshido\GraphQL\Parser\Ast\Field as FieldAST;
16
use Youshido\GraphQL\Parser\Location;
17
use Youshido\GraphQL\Type\Scalar\IntType;
18
use Youshido\Tests\DataProvider\TestSchema;
19
20
class ResolveInfoTest extends \PHPUnit_Framework_TestCase
21
{
22
    public function testMethods()
23
    {
24
        $fieldAst         = new FieldAST('name', null, [], [], new Location(1,1));
25
        $field            = new Field(['name' => 'id', 'type' => new IntType()]);
26
        $returnType       = new IntType();
27
        $executionContext = new ExecutionContext(new TestSchema());
28
        $info             = new ResolveInfo($field, [$fieldAst], $executionContext);
29
30
        $this->assertEquals($field, $info->getField());
31
        $this->assertEquals([$fieldAst], $info->getFieldASTList());
32
        $this->assertEquals($returnType, $info->getReturnType());
33
        $this->assertEquals($executionContext, $info->getExecutionContext());
34
    }
35
}
36