Completed
Push — master ( e8c337...7f89eb )
by Alexandr
02:46
created

InterfaceTypeConfigTest::testCreation()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 12
rs 9.4286
cc 1
eloc 8
nc 1
nop 0
1
<?php
2
/*
3
* This file is a part of GraphQL project.
4
*
5
* @author Alexandr Viniychuk <[email protected]>
6
* created: 12/6/15 12:49 AM
7
*/
8
9
namespace Youshido\Tests\Type;
10
11
12
use Youshido\GraphQL\Type\ListType\ListType;
13
use Youshido\GraphQL\Type\Object\InterfaceType;
14
use Youshido\GraphQL\Type\TypeMap;
15
use Youshido\Tests\Schema\CharacterInterface;
16
17
class InterfaceTypeConfigTest extends \PHPUnit_Framework_TestCase
18
{
19
20
    public function testCreation()
21
    {
22
        $characterInterface = new CharacterInterface();
23
        $this->assertEquals('Character', $characterInterface->getName());
24
        $this->assertEquals(TypeMap::KIND_INTERFACE, $characterInterface->getKind());
25
26
        $fields = $characterInterface->getConfig()->getFields();
27
        $this->assertArrayHasKey('id', $fields);
28
29
        $this->assertEquals(TypeMap::TYPE_ID, $fields['id']->getType()->getName());
30
        $this->assertEquals(TypeMap::KIND_SCALAR, $fields['id']->getType()->getKind());
31
    }
32
33
}
34