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.

Code Duplication    Length = 40-41 lines in 2 locations

tests/Api/ConnectionsModuleTest.php 1 location

@@ 37-77 (lines=41) @@
34
    /** @var \SURFnet\VPN\Common\Http\Service */
35
    private $service;
36
37
    public function setUp()
38
    {
39
        $random = $this->getMockBuilder('SURFnet\VPN\Common\RandomInterface')->getMock();
40
        $random->method('get')->will($this->onConsecutiveCalls('random_1', 'random_2'));
41
42
        $storage = new Storage(
43
            new PDO('sqlite::memory:'),
44
            $random
45
        );
46
        $storage->init();
47
        $storage->addCertificate('foo', '12345678901234567890123456789012', '12345678901234567890123456789012', 12345678, 23456789);
48
        $storage->setTotpSecret('foo', 'CN2XAL23SIFTDFXZ');
49
        $storage->clientConnect('internet', '12345678901234567890123456789012', '10.10.10.10', 'fd00:4242:4242:4242::', 12345678);
50
51
        $config = Config::fromFile(sprintf('%s/data/config.yaml', __DIR__));
52
53
        $groupProviders = [
54
            new StaticProvider(
55
                new Config(
56
                    $config->v('groupProviders', 'StaticProvider')
57
                )
58
            ),
59
        ];
60
61
        $this->service = new Service();
62
        $this->service->addModule(
63
            new ConnectionsModule(
64
                $config,
65
                $storage,
66
                $groupProviders
67
            )
68
        );
69
70
        $bearerAuthentication = new BasicAuthenticationHook(
71
            [
72
                'vpn-server-node' => 'aabbcc',
73
            ]
74
        );
75
76
        $this->service->addBeforeHook('auth', $bearerAuthentication);
77
    }
78
79
    public function testConnect()
80
    {

tests/Api/UsersModuleTest.php 1 location

@@ 37-76 (lines=40) @@
34
    /** @var \SURFnet\VPN\Common\Http\Service */
35
    private $service;
36
37
    public function setUp()
38
    {
39
        $random = $this->getMockBuilder('SURFnet\VPN\Common\RandomInterface')->getMock();
40
        $random->method('get')->will($this->onConsecutiveCalls('random_1', 'random_2'));
41
42
        $storage = new Storage(
43
            new PDO('sqlite::memory:'),
44
            $random
45
        );
46
        $storage->init();
47
48
        $storage->addCertificate('foo', 'abcd1234', 'ABCD1234', 12345678, 23456789);
49
        $storage->disableUser('bar');
50
        $storage->setTotpSecret('bar', 'CN2XAL23SIFTDFXZ');
51
        $storage->setVootToken('bar', '123456');
52
53
        $config = Config::fromFile(sprintf('%s/data/user_groups_config.yaml', __DIR__));
54
        $groupProviders = [
55
            new StaticProvider(
56
                new Config($config->v('groupProviders', 'StaticProvider'))
57
            ),
58
        ];
59
60
        $this->service = new Service();
61
        $this->service->addModule(
62
            new UsersModule(
63
                $storage,
64
                $groupProviders
65
            )
66
        );
67
68
        $bearerAuthentication = new BasicAuthenticationHook(
69
            [
70
                'vpn-user-portal' => 'aabbcc',
71
                'vpn-admin-portal' => 'bbccdd',
72
            ]
73
        );
74
75
        $this->service->addBeforeHook('auth', $bearerAuthentication);
76
    }
77
78
    public function testListUsers()
79
    {