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 ( 8ed6f1...ecc169 )
by Rodrigue
03:16
created

FeatureContext   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 4
Bugs 2 Features 1
Metric Value
wmc 5
c 4
b 2
f 1
lcom 1
cbo 3
dl 0
loc 58
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A setUpSuite() 0 4 1
A setScenarioState() 0 4 1
A takeBanana() 0 4 1
A giveBananaToGorilla() 0 7 1
A gorillaHasBanana() 0 5 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
use Gorghoa\ScenarioStateBehatExtension\Annotation\ScenarioStateArgument;
13
use Gorghoa\ScenarioStateBehatExtension\Context\ScenarioStateAwareContext;
14
use Gorghoa\ScenarioStateBehatExtension\ScenarioStateInterface;
15
use Gorghoa\ScenarioStateBehatExtension\TestApp\Gorilla;
16
17
/**
18
 * @author Rodrigue Villetard <[email protected]>
19
 */
20
class FeatureContext implements ScenarioStateAwareContext
21
{
22
    /**
23
     * @beforeSuite
24
     */
25
    public static function setUpSuite()
26
    {
27
        require_once __DIR__.'/../../autoload.php';
28
    }
29
30
    /**
31
     * @var ScenarioStateInterface
32
     */
33
    private $scenarioState;
34
35
    public function setScenarioState(ScenarioStateInterface $scenarioState)
36
    {
37
        $this->scenarioState = $scenarioState;
38
    }
39
40
    /**
41
     * @When the bonobo takes a banana
42
     */
43
    public function takeBanana()
44
    {
45
        $this->scenarioState->provideStateFragment('scenarioBanana', 'Yammy Banana');
46
    }
47
48
    /**
49
     * @When gives this banana to gorilla
50
     *
51
     * @ScenarioStateArgument("scenarioBanana")
52
     *
53
     * @param string $scenarioBanana
54
     */
55
    public function giveBananaToGorilla($scenarioBanana)
56
    {
57
        \PHPUnit_Framework_Assert::assertEquals($scenarioBanana, 'Yammy Banana');
58
        $gorilla = new Gorilla();
59
        $gorilla->setBanana($scenarioBanana);
60
        $this->scenarioState->provideStateFragment('scenarioGorilla', $gorilla);
61
    }
62
63
    /**
64
     * @Then the gorilla has the banana
65
     *
66
     * @ScenarioStateArgument("scenarioBanana")
67
     * @ScenarioStateArgument(name="scenarioGorilla", argument="gorilla")
68
     *
69
     * @param string  $scenarioBanana
70
     * @param Gorilla $gorilla
71
     */
72
    public function gorillaHasBanana($scenarioBanana, Gorilla $gorilla)
73
    {
74
        \PHPUnit_Framework_Assert::assertEquals($scenarioBanana, 'Yammy Banana');
75
        \PHPUnit_Framework_Assert::assertEquals($gorilla->getBanana(), 'Yammy Banana');
76
    }
77
}
78