Completed
Push — master ( 924012...c1a650 )
by David
16s queued 10s
created

IDTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 6
dl 0
loc 13
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testVal() 0 5 1
A testConstructException() 0 4 1
1
<?php
2
3
namespace TheCodingMachine\GraphQL\Controllers\Types;
4
5
use InvalidArgumentException;
6
use PHPUnit\Framework\TestCase;
7
use stdClass;
8
9
class IDTest extends TestCase
10
{
11
    public function testConstructException()
12
    {
13
        $this->expectException(InvalidArgumentException::class);
14
        new ID(new stdClass());
15
    }
16
17
    public function testVal()
18
    {
19
        $id = new ID(42);
20
        $this->assertSame(42, $id->val());
21
        $this->assertSame('42', (string) $id);
22
    }
23
}
24