1 | <?php |
||
25 | final class ManagingCurrenciesContext implements Context |
||
26 | { |
||
27 | /** |
||
28 | * @var IndexPageInterface |
||
29 | */ |
||
30 | private $indexPage; |
||
31 | |||
32 | /** |
||
33 | * @var CreatePageInterface |
||
34 | */ |
||
35 | private $createPage; |
||
36 | |||
37 | /** |
||
38 | * @var UpdatePageInterface |
||
39 | */ |
||
40 | private $updatePage; |
||
41 | |||
42 | /** |
||
43 | * @var CurrentPageResolverInterface |
||
44 | */ |
||
45 | private $currentPageResolver; |
||
46 | |||
47 | /** |
||
48 | * @param IndexPageInterface $indexPage |
||
49 | * @param CreatePageInterface $createPage |
||
50 | * @param UpdatePageInterface $updatePage |
||
51 | * @param CurrentPageResolverInterface $currentPageResolver |
||
52 | */ |
||
53 | public function __construct( |
||
64 | |||
65 | /** |
||
66 | * @Given I want to add a new currency |
||
67 | */ |
||
68 | public function iWantToAddNewCurrency() |
||
72 | |||
73 | /** |
||
74 | * @When I choose :currencyName |
||
75 | */ |
||
76 | public function iChoose($currencyName) |
||
80 | |||
81 | /** |
||
82 | * @When I add it |
||
83 | * @When I try to add it |
||
84 | */ |
||
85 | public function iAddIt() |
||
89 | |||
90 | /** |
||
91 | * @When I specify its exchange rate as :exchangeRate |
||
92 | */ |
||
93 | public function iSpecifyExchangeRate($exchangeRate) |
||
97 | |||
98 | /** |
||
99 | * @Then the currency :currency should appear in the store |
||
100 | * @Then I should see the currency :currency in the list |
||
101 | */ |
||
102 | public function currencyShouldAppearInTheStore(CurrencyInterface $currency) |
||
111 | |||
112 | /** |
||
113 | * @Given /^I want to edit (this currency)$/ |
||
114 | */ |
||
115 | public function iWantToEditThisCurrency(CurrencyInterface $currency) |
||
119 | |||
120 | /** |
||
121 | * @When I enable it |
||
122 | */ |
||
123 | public function iEnableIt() |
||
127 | |||
128 | /** |
||
129 | * @When I disable it |
||
130 | */ |
||
131 | public function iDisableIt() |
||
135 | |||
136 | /** |
||
137 | * @Then I should not be able to disable this currency |
||
138 | */ |
||
139 | public function iCannotDisableIt() |
||
146 | |||
147 | /** |
||
148 | * @Then I should not be able to change exchange rate of this currency |
||
149 | */ |
||
150 | public function iCannotChangeItsExchangeRate() |
||
157 | |||
158 | /** |
||
159 | * @When I save my changes |
||
160 | * @When I try to save my changes |
||
161 | */ |
||
162 | public function iSaveMyChanges() |
||
166 | |||
167 | /** |
||
168 | * @Then /^(this currency) should be disabled$/ |
||
169 | */ |
||
170 | public function thisCurrencyShouldBeDisabled(CurrencyInterface $currency) |
||
179 | |||
180 | /** |
||
181 | * @Then /^(this currency) should be enabled$/ |
||
182 | */ |
||
183 | public function thisCurrencyShouldBeEnabled(CurrencyInterface $currency) |
||
192 | |||
193 | /** |
||
194 | * @When I change exchange rate to :exchangeRate |
||
195 | */ |
||
196 | public function iChangeExchangeRateTo($exchangeRate) |
||
200 | |||
201 | /** |
||
202 | * @Then this currency should have exchange rate :exchangeRate |
||
203 | */ |
||
204 | public function thisCurrencyShouldHaveExchangeRate($exchangeRate) |
||
216 | |||
217 | /** |
||
218 | * @Then the code field should be disabled |
||
219 | */ |
||
220 | public function theCodeFiledShouldBeDisabled() |
||
228 | |||
229 | /** |
||
230 | * @Then I should be notified that currency code must be unique |
||
231 | */ |
||
232 | public function iShouldBeNotifiedThatCurrencyCodeMustBeUnique() |
||
236 | |||
237 | /** |
||
238 | * @Then there should still be only one currency with :element :code |
||
239 | */ |
||
240 | public function thereShouldStillBeOnlyOneCurrencyWithCode($element, $codeValue) |
||
249 | |||
250 | /** |
||
251 | * @Then I should be notified that exchange rate is required |
||
252 | */ |
||
253 | public function iShouldBeNotifiedThatExchangeRateIsRequired() |
||
260 | |||
261 | /** |
||
262 | * @Then the currency :currencyName should not be added |
||
263 | */ |
||
264 | public function theCurrencyShouldNotBeAdded($currencyName) |
||
273 | |||
274 | /** |
||
275 | * @When I remove its exchange rate |
||
276 | */ |
||
277 | public function iRemoveItsExchangeRate() |
||
281 | |||
282 | /** |
||
283 | * @Then /^(this currency) should still have exchange rate equal to ([0-9\.]+)$/ |
||
284 | */ |
||
285 | public function theCurrencyShouldStillHaveExchangeRateEquals(CurrencyInterface $currency, $exchangeRate) |
||
299 | |||
300 | /** |
||
301 | * @Given I want to browse currencies of the store |
||
302 | */ |
||
303 | public function iWantToSeeAllCurrenciesInStore() |
||
307 | |||
308 | /** |
||
309 | * @Then /^I should see (\d+) currencies in the list$/ |
||
310 | */ |
||
311 | public function iShouldSeeCurrenciesInTheList($amountOfCurrencies) |
||
323 | } |
||
324 |