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 ( 7e7a73...d8bfad )
by Rodrigue
04:11
created

ScenarioStateHookableScenarioTester::test()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 4
crap 1
1
<?php
2
3
/*
4
 * This file is part of the ScenarioStateBehatExtension project.
5
 *
6
 * (c) Rodrigue Villetard <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Gorghoa\ScenarioStateBehatExtension\Hook\Tester;
13
14
use Behat\Behat\Hook\Scope\AfterScenarioScope;
15
use Behat\Behat\Hook\Scope\BeforeScenarioScope;
16
use Behat\Behat\Tester\ScenarioTester;
17
use Behat\Gherkin\Node\FeatureNode;
18
use Behat\Gherkin\Node\ScenarioInterface as Scenario;
19
use Behat\Testwork\Environment\Environment;
20
use Behat\Testwork\Hook\Tester\Setup\HookedSetup;
21
use Behat\Testwork\Hook\Tester\Setup\HookedTeardown;
22
use Behat\Testwork\Tester\Result\TestResult;
23
use Gorghoa\ScenarioStateBehatExtension\Hook\Dispatcher\ScenarioStateHookDispatcher;
24
25
/**
26
 * @author Vincent Chalamon <[email protected]>
27
 */
28
final class ScenarioStateHookableScenarioTester implements ScenarioTester
29
{
30
    /**
31
     * @var ScenarioTester
32
     */
33
    private $baseTester;
34
35
    /**
36
     * @var ScenarioStateHookDispatcher
37
     */
38
    private $dispatcher;
39
40
    /**
41
     * @param ScenarioTester      $baseTester
42
     * @param ScenarioStateHookDispatcher $dispatcher
43
     */
44 3
    public function __construct(ScenarioTester $baseTester, ScenarioStateHookDispatcher $dispatcher)
45
    {
46 3
        $this->baseTester = $baseTester;
47 3
        $this->dispatcher = $dispatcher;
48 3
    }
49
50
    /**
51
     * {@inheritdoc}
52
     */
53 1 View Code Duplication
    public function setUp(Environment $env, FeatureNode $feature, Scenario $scenario, $skip)
54
    {
55 1
        $setup = $this->baseTester->setUp($env, $feature, $scenario, true);
56
57 1
        if ($skip) {
58 1
            return $setup;
59
        }
60
61
        return new HookedSetup($setup, $this->dispatcher->dispatchScopeHooks(new BeforeScenarioScope($env, $feature, $scenario)));
62
    }
63
64
    /**
65
     * {@inheritdoc}
66
     */
67 1
    public function test(Environment $env, FeatureNode $feature, Scenario $scenario, $skip)
68
    {
69 1
        return $this->baseTester->test($env, $feature, $scenario, $skip);
70
    }
71
72
    /**
73
     * {@inheritdoc}
74
     */
75 1 View Code Duplication
    public function tearDown(Environment $env, FeatureNode $feature, Scenario $scenario, $skip, TestResult $result)
76
    {
77 1
        $teardown = $this->baseTester->tearDown($env, $feature, $scenario, true, $result);
78
79 1
        if ($skip) {
80 1
            return $teardown;
81
        }
82
83
        return new HookedTeardown($teardown, $this->dispatcher->dispatchScopeHooks(new AfterScenarioScope($env, $feature, $scenario, $result)));
84
    }
85
}
86