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 ( 5892ba...e25f6a )
by Baptiste
03:37 queued 29s
created

UnixProcessesTest::testInterface()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
declare(strict_types = 1);
3
4
namespace Tests\Innmind\Server\Status\Server\Processes;
5
6
use Innmind\Server\Status\{
7
    Server\Processes\UnixProcesses,
8
    Server\Processes,
9
    Server\Process,
10
    Server\Process\Pid,
11
    Exception\InformationNotAccessible,
12
};
13
use Innmind\TimeContinuum\Earth\Clock;
14
use Innmind\Immutable\Map;
15
use PHPUnit\Framework\TestCase;
16
17
class UnixProcessesTest extends TestCase
18
{
19
    public function testInterface()
20
    {
21
        $this->assertInstanceOf(Processes::class, new UnixProcesses(new Clock));
22
    }
23
24
    public function testAll()
25
    {
26
        if (!in_array(PHP_OS, ['Darwin', 'Linux'])) {
27
            return;
28
        }
29
30
        $all = (new UnixProcesses(new Clock))->all();
31
32
        $this->assertInstanceOf(Map::class, $all);
33
        $this->assertSame('int', (string) $all->keyType());
34
        $this->assertSame(Process::class, (string) $all->valueType());
35
        $this->assertTrue($all->size() > 0);
36
        $this->assertSame('root', $all->get(1)->user()->toString());
37
    }
38
39
    public function testGet()
40
    {
41
        if (!in_array(PHP_OS, ['Darwin', 'Linux'])) {
42
            return;
43
        }
44
45
        $process = (new UnixProcesses(new Clock))->get(new Pid(1));
46
47
        $this->assertInstanceOf(Process::class, $process);
48
        $this->assertSame('root', $process->user()->toString());
49
    }
50
51
    public function testThrowWhenProcessFails()
52
    {
53
        $this->expectException(InformationNotAccessible::class);
54
55
        (new UnixProcesses(new Clock))->get(new Pid(42424));
56
    }
57
}
58