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.
Completed
Push — master ( 8d4bd8...cfe123 )
by François
02:24 queued 46s
created

StatusParserTest::testOpenVpn24()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 28
Code Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 28
rs 8.8571
cc 1
eloc 17
nc 1
nop 0
1
<?php
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 26 and the first side effect is on line 21.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
/**
3
 *  Copyright (C) 2016 SURFnet.
4
 *
5
 *  This program is free software: you can redistribute it and/or modify
6
 *  it under the terms of the GNU Affero General Public License as
7
 *  published by the Free Software Foundation, either version 3 of the
8
 *  License, or (at your option) any later version.
9
 *
10
 *  This program is distributed in the hope that it will be useful,
11
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 *  GNU Affero General Public License for more details.
14
 *
15
 *  You should have received a copy of the GNU Affero General Public License
16
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
 */
18
19
namespace SURFnet\VPN\Server\OpenVpn;
20
21
require_once sprintf('%s/Test/TestSocket.php', __DIR__);
22
23
use PHPUnit_Framework_TestCase;
24
use SURFnet\VPN\Server\OpenVpn\Test\TestSocket;
25
26
class StatusParserTest extends PHPUnit_Framework_TestCase
27
{
28
    public function testOpenVpn23()
29
    {
30
        $this->assertSame(
31
            [
32
                [
33
                    'common_name' => 'fkooman_testdroid',
34
                    'user_id' => 'fkooman',
35
                    'name' => 'testdroid',
36
                    'proto' => 6,
37
                    'virtual_address' => [
38
                        'fd77:6bac:e591:8203::1001',
39
                        '10.120.188.195',
40
                    ],
41
                ],
42
                [
43
                    'common_name' => 'fkooman_lenovo_f24',
44
                    'user_id' => 'fkooman',
45
                    'name' => 'lenovo_f24',
46
                    'proto' => 4,
47
                    'virtual_address' => [
48
                        '10.120.188.194',
49
                        'fd77:6bac:e591:8203::1000',
50
                    ],
51
                ],
52
            ],
53
            StatusParser::parse(explode("\n", file_get_contents(__DIR__.'/data/socket/openvpn_23_status.txt')))
54
        );
55
    }
56
57
    public function testOpenVpn24()
58
    {
59
        $this->assertSame(
60
            [
61
                [
62
                    'common_name' => 'fkooman_testdroid',
63
                    'user_id' => 'fkooman',
64
                    'name' => 'testdroid',
65
                    'proto' => 6,
66
                    'virtual_address' => [
67
                        'fd77:6bac:e591:8203::1001',
68
                        '10.120.188.195',
69
                    ],
70
                ],
71
                [
72
                    'common_name' => 'fkooman_lenovo_f24',
73
                    'user_id' => 'fkooman',
74
                    'name' => 'lenovo_f24',
75
                    'proto' => 4,
76
                    'virtual_address' => [
77
                        'fd77:6bac:e591:8203::1000',
78
                        '10.120.188.194',
79
                    ],
80
                ],
81
            ],
82
            StatusParser::parse(explode("\n", file_get_contents(__DIR__.'/data/socket/openvpn_24_status.txt')))
83
        );
84
    }
85
}
86