Completed
Pull Request — master (#204)
by Ryan
11:34
created

NodeTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 12
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Copyright (c) 2015–2018 Alexandr Viniychuk <http://youshido.com>.
4
 * Copyright (c) 2015–2018 Portey Vasil <https://github.com/portey>.
5
 * Copyright (c) 2018 Ryan Parman <https://github.com/skyzyx>.
6
 * Copyright (c) 2018 Ashley Hutson <https://github.com/asheliahut>.
7
 * Copyright (c) 2015–2018 Contributors.
8
 *
9
 * http://opensource.org/licenses/MIT
10
 */
11
12
declare(strict_types=1);
13
/*
14
 * This file is a part of GraphQL project.
15
 *
16
 * @author Alexandr Viniychuk <[email protected]>
17
 * created: 3:59 PM 5/17/16
18
 */
19
20
namespace Youshido\Tests\Library\Relay;
21
22
use Youshido\GraphQL\Relay\Node;
23
24
class NodeTest extends \PHPUnit_Framework_TestCase
25
{
26
    public function testMethods(): void
27
    {
28
        $global     = Node::toGlobalId('user', 1);
29
        $fromGlobal = Node::fromGlobalId($global);
30
31
        $this->assertEquals('user', $fromGlobal[0]);
32
        $this->assertEquals(1, $fromGlobal[1]);
33
        $this->assertEquals([null, null], Node::fromGlobalId(null));
34
    }
35
}
36