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.

BootstrapServiceTest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 12
dl 0
loc 55
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 3 1
A itFailsOnWrongConfiguration() 0 3 1
A getWrongScenarios() 0 11 1
A itShouldSkipWithCorrectKeyWithWrongValue() 0 8 1
1
<?php
2
3
namespace Tests\AndreyOrs\BehatBootstrap;
4
5
use AndreyOrs\BehatBootstrap\BootstrapService;
6
7
class BootstrapServiceTest extends \PHPUnit\Framework\TestCase
8
{
9
    /**
10
     * @var BootstrapService
11
     */
12
    private $service;
13
14
    /**
15
     * Set up service
16
     */
17
    public function setUp()
18
    {
19
        $this->service = new BootstrapService();
20
    }
21
22
    /**
23
     * @test
24
     * @dataProvider getWrongScenarios
25
     *
26
     * @param array $config
27
     */
28
    public function itFailsOnWrongConfiguration(array $config)
29
    {
30
        self::assertFalse($this->service->load($config));
31
    }
32
33
    /**
34
     * @test
35
     */
36
    public function itShouldSkipWithCorrectKeyWithWrongValue()
37
    {
38
        self::assertTrue(
39
            $this->service->load(
40
                [
41
                    BootstrapService::CONFIGURATION_KEY => [
42
                        [
43
                            'wrong-key' => 'ls -la',
44
                        ],
45
                    ],
46
                ]
47
            )
48
        );
49
    }
50
51
    public function getWrongScenarios()
52
    {
53
        return [
54
            [
55
                'empty array' => [],
56
            ],
57
            [
58
                'wrong config' => ['wrong-key' => []],
59
            ],
60
            [
61
                'empty config' => [BootstrapService::CONFIGURATION_KEY => []],
62
            ],
63
        ];
64
    }
65
66
}
67