1 | <?php |
||
24 | final class ManagingTaxCategoriesContext implements Context |
||
25 | { |
||
26 | /** @var IndexPageInterface */ |
||
27 | private $indexPage; |
||
28 | |||
29 | /** @var CreatePageInterface */ |
||
30 | private $createPage; |
||
31 | |||
32 | /** @var UpdatePageInterface */ |
||
33 | private $updatePage; |
||
34 | |||
35 | /** @var CurrentPageResolverInterface */ |
||
36 | private $currentPageResolver; |
||
37 | |||
38 | public function __construct( |
||
49 | |||
50 | /** |
||
51 | * @When I delete tax category :taxCategory |
||
52 | */ |
||
53 | public function iDeletedTaxCategory(TaxCategoryInterface $taxCategory) |
||
58 | |||
59 | /** |
||
60 | * @Then /^(this tax category) should no longer exist in the registry$/ |
||
61 | */ |
||
62 | public function thisTaxCategoryShouldNoLongerExistInTheRegistry(TaxCategoryInterface $taxCategory) |
||
66 | |||
67 | /** |
||
68 | * @Given I want to create a new tax category |
||
69 | */ |
||
70 | public function iWantToCreateNewTaxCategory() |
||
74 | |||
75 | /** |
||
76 | * @When I specify its code as :code |
||
77 | * @When I do not specify its code |
||
78 | */ |
||
79 | public function iSpecifyItsCodeAs($code = null) |
||
83 | |||
84 | /** |
||
85 | * @When I name it :name |
||
86 | * @When I rename it to :name |
||
87 | * @When I do not name it |
||
88 | * @When I remove its name |
||
89 | */ |
||
90 | public function iNameIt($name = null) |
||
94 | |||
95 | /** |
||
96 | * @When I add it |
||
97 | * @When I try to add it |
||
98 | */ |
||
99 | public function iAddIt() |
||
103 | |||
104 | /** |
||
105 | * @Then I should see the tax category :taxCategoryName in the list |
||
106 | * @Then the tax category :taxCategoryName should appear in the registry |
||
107 | */ |
||
108 | public function theTaxCategoryShouldAppearInTheRegistry(string $taxCategoryName): void |
||
113 | |||
114 | /** |
||
115 | * @When I describe it as :description |
||
116 | */ |
||
117 | public function iDescribeItAs($description) |
||
121 | |||
122 | /** |
||
123 | * @Given I want to modify a tax category :taxCategory |
||
124 | * @Given /^I want to modify (this tax category)$/ |
||
125 | */ |
||
126 | public function iWantToModifyTaxCategory(TaxCategoryInterface $taxCategory) |
||
130 | |||
131 | /** |
||
132 | * @When I save my changes |
||
133 | * @When I try to save my changes |
||
134 | */ |
||
135 | public function iSaveMyChanges() |
||
139 | |||
140 | /** |
||
141 | * @When I browse tax categories |
||
142 | */ |
||
143 | public function iWantToBrowseTaxCategories(): void |
||
147 | |||
148 | /** |
||
149 | * @When I check (also) the :taxCategoryName tax category |
||
150 | */ |
||
151 | public function iCheckTheTaxCategory(string $taxCategoryName): void |
||
155 | |||
156 | /** |
||
157 | * @When I delete them |
||
158 | */ |
||
159 | public function iDeleteThem(): void |
||
163 | |||
164 | /** |
||
165 | * @Then I should not be able to edit its code |
||
166 | */ |
||
167 | public function iShouldNotBeAbleToEditItsCode(): void |
||
168 | { |
||
169 | Assert::true($this->updatePage->isCodeDisabled()); |
||
170 | } |
||
171 | |||
172 | /** |
||
173 | * @Then /^(this tax category) name should be "([^"]+)"$/ |
||
174 | * @Then /^(this tax category) should still be named "([^"]+)"$/ |
||
175 | */ |
||
176 | public function thisTaxCategoryNameShouldBe(TaxCategoryInterface $taxCategory, $taxCategoryName) |
||
181 | |||
182 | /** |
||
183 | * @Then I should be notified that tax category with this code already exists |
||
184 | */ |
||
185 | public function iShouldBeNotifiedThatTaxCategoryWithThisCodeAlreadyExists() |
||
189 | |||
190 | /** |
||
191 | * @Then there should still be only one tax category with :element :code |
||
192 | */ |
||
193 | public function thereShouldStillBeOnlyOneTaxCategoryWith($element, $code) |
||
198 | |||
199 | /** |
||
200 | * @Then I should be notified that :element is required |
||
201 | */ |
||
202 | public function iShouldBeNotifiedThatIsRequired($element) |
||
209 | |||
210 | /** |
||
211 | * @Then tax category with :element :name should not be added |
||
212 | */ |
||
213 | public function taxCategoryWithElementValueShouldNotBeAdded($element, $name) |
||
218 | |||
219 | /** |
||
220 | * @Then I should see a single tax category in the list |
||
221 | */ |
||
222 | public function iShouldSeeTaxCategoriesInTheList(): void |
||
226 | } |
||
227 |