1 | <?php |
||
22 | class FeatureContext implements ScenarioStateAwareContext |
||
23 | { |
||
24 | /** |
||
25 | * @BeforeSuite |
||
26 | */ |
||
27 | public static function setUpSuite() |
||
31 | |||
32 | /** |
||
33 | * @var ScenarioStateInterface |
||
34 | */ |
||
35 | private $scenarioState; |
||
36 | |||
37 | /** |
||
38 | * @param ScenarioStateInterface $scenarioState |
||
39 | */ |
||
40 | public function setScenarioState(ScenarioStateInterface $scenarioState) |
||
44 | |||
45 | /** |
||
46 | * @BeforeScenario |
||
47 | */ |
||
48 | public function initBananas() |
||
53 | |||
54 | /** |
||
55 | * @BeforeScenario |
||
56 | * |
||
57 | * @ScenarioStateArgument("bananas") |
||
58 | * |
||
59 | * @param array $bananas |
||
60 | */ |
||
61 | public function saveBananasWithoutScopeBeforeScenario(array $bananas) |
||
65 | |||
66 | /** |
||
67 | * @BeforeScenario |
||
68 | * |
||
69 | * @ScenarioStateArgument("bananas") |
||
70 | * |
||
71 | * @param BeforeScenarioScope $scope |
||
72 | * @param array $bananas |
||
73 | */ |
||
74 | public function saveBananasWithScopeBeforeScenario(BeforeScenarioScope $scope, array $bananas) |
||
79 | |||
80 | /** |
||
81 | * @BeforeScenario |
||
82 | * |
||
83 | * @param BeforeScenarioScope $scope |
||
84 | */ |
||
85 | public function initApplesBeforeScenario(BeforeScenarioScope $scope) |
||
89 | |||
90 | /** |
||
91 | * @AfterScenario |
||
92 | * |
||
93 | * @ScenarioStateArgument("bananas") |
||
94 | * |
||
95 | * @param array $bananas |
||
96 | */ |
||
97 | public function saveBananasWithoutScopeAfterScenario(array $bananas) |
||
101 | |||
102 | /** |
||
103 | * @AfterScenario |
||
104 | * |
||
105 | * @ScenarioStateArgument("bananas") |
||
106 | * |
||
107 | * @param array $bananas |
||
108 | * @param AfterScenarioScope $scope |
||
109 | */ |
||
110 | public function saveBananasWithScopeAfterScenario(array $bananas, AfterScenarioScope $scope) |
||
115 | |||
116 | /** |
||
117 | * @AfterScenario |
||
118 | * |
||
119 | * @param AfterScenarioScope $scope |
||
120 | */ |
||
121 | public function initApplesAfterScenario(AfterScenarioScope $scope) |
||
125 | |||
126 | /** |
||
127 | * @When the bonobo takes a banana |
||
128 | */ |
||
129 | public function takeBanana() |
||
133 | |||
134 | /** |
||
135 | * @Transform :gorilla |
||
136 | * |
||
137 | * @ScenarioStateArgument(name="gorillaIsMale", argument="isMale") |
||
138 | * |
||
139 | * @param string $gorilla |
||
140 | * @param bool $isMale |
||
141 | * |
||
142 | * @return Gorilla |
||
143 | */ |
||
144 | public function transformGorilla($gorilla, $isMale) |
||
152 | |||
153 | /** |
||
154 | * @When gives this banana to :gorilla |
||
155 | * |
||
156 | * @ScenarioStateArgument("scenarioBanana") |
||
157 | * |
||
158 | * @param string $scenarioBanana |
||
159 | * @param Gorilla $gorilla |
||
160 | */ |
||
161 | public function giveBananaToGorilla($scenarioBanana, Gorilla $gorilla) |
||
167 | |||
168 | /** |
||
169 | * @Then the gorilla has the banana |
||
170 | * |
||
171 | * @ScenarioStateArgument("scenarioBanana") |
||
172 | * @ScenarioStateArgument(name="scenarioGorilla", argument="gorilla") |
||
173 | * |
||
174 | * @param string $scenarioBanana |
||
175 | * @param Gorilla $gorilla |
||
176 | */ |
||
177 | public function gorillaHasBanana($scenarioBanana, Gorilla $gorilla) |
||
182 | } |
||
183 |