GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( fd060d...258593 )
by Baptiste
03:01 queued 10s
created

NullableTypeTest::testDoesntThrowWhenValueIsNull()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 0
dl 0
loc 10
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types = 1);
3
4
namespace Tests\Innmind\Immutable\ValidateArgument;
5
6
use Innmind\Immutable\{
7
    ValidateArgument\NullableType,
8
    ValidateArgument,
9
};
10
use PHPUnit\Framework\TestCase;
11
12
class NullableTypeTest extends TestCase
13
{
14
    public function testInterface()
15
    {
16
        $type = new NullableType(
17
            $this->createMock(ValidateArgument::class)
18
        );
19
20
        $this->assertInstanceOf(ValidateArgument::class, $type);
21
    }
22
23
    public function testDoesntThrowWhenValueIsNull()
24
    {
25
        $type = new NullableType(
26
            $inner = $this->createMock(ValidateArgument::class)
27
        );
28
        $inner
29
            ->expects($this->never())
30
            ->method('__invoke');
31
32
        $this->assertNull($type(null, 1));
33
    }
34
35
    public function testUseUnderlyingTypeWhenValueIsNotNull()
36
    {
37
        $type = new NullableType(
38
            $inner = $this->createMock(ValidateArgument::class)
39
        );
40
        $value = new \stdClass;
41
        $inner
42
            ->expects($this->once())
43
            ->method('__invoke')
44
            ->with($value, 1);
45
46
        $this->assertNull($type($value, 1));
47
    }
48
}
49