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   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
eloc 17
c 2
b 0
f 1
dl 0
loc 39
rs 10
wmc 6

4 Methods

Rating   Name   Duplication   Size   Complexity  
A testThrowWhenProcessFails() 0 5 1
A testAll() 0 13 2
A testGet() 0 10 2
A testInterface() 0 3 1
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