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

IDTest::testConstructException()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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