1 | <?php |
||
21 | final class ManagingTaxCategoriesContext implements Context |
||
22 | { |
||
23 | /** @var ApiClientInterface */ |
||
24 | private $client; |
||
25 | |||
26 | public function __construct(ApiClientInterface $client) |
||
30 | |||
31 | /** |
||
32 | * @When I want to create a new tax category |
||
33 | */ |
||
34 | public function iWantToCreateNewTaxCategory(): void |
||
38 | |||
39 | /** |
||
40 | * @When I want to modify a tax category :taxCategory |
||
41 | * @When /^I want to modify (this tax category)$/ |
||
42 | */ |
||
43 | public function iWantToModifyTaxCategory(TaxCategoryInterface $taxCategory): void |
||
47 | |||
48 | /** |
||
49 | * @When I delete tax category :taxCategory |
||
50 | */ |
||
51 | public function iDeleteTaxCategory(TaxCategoryInterface $taxCategory): void |
||
55 | |||
56 | /** |
||
57 | * @When I specify its code as :code |
||
58 | * @When I do not specify its code |
||
59 | */ |
||
60 | public function iSpecifyItsCodeAs(?string $code = null): void |
||
66 | |||
67 | /** |
||
68 | * @When I name it :name |
||
69 | * @When I rename it to :name |
||
70 | * @When I do not name it |
||
71 | */ |
||
72 | public function iNameIt(?string $name = null): void |
||
78 | |||
79 | /** |
||
80 | * @When I remove its name |
||
81 | */ |
||
82 | public function iRemoveItsName(): void |
||
86 | |||
87 | /** |
||
88 | * @When I add it |
||
89 | * @When I try to add it |
||
90 | */ |
||
91 | public function iAddIt(): void |
||
95 | |||
96 | /** |
||
97 | * @When I describe it as :description |
||
98 | */ |
||
99 | public function iDescribeItAs(string $description): void |
||
103 | |||
104 | /** |
||
105 | * @When I save my changes |
||
106 | * @When I try to save my changes |
||
107 | */ |
||
108 | public function iSaveMyChanges(): void |
||
112 | |||
113 | /** |
||
114 | * @When I browse tax categories |
||
115 | */ |
||
116 | public function iWantToBrowseTaxCategories(): void |
||
120 | |||
121 | /** |
||
122 | * @Then /^(this tax category) should no longer exist in the registry$/ |
||
123 | */ |
||
124 | public function thisTaxCategoryShouldNoLongerExistInTheRegistry(TaxCategoryInterface $taxCategory): void |
||
132 | |||
133 | /** |
||
134 | * @Then I should see the tax category :taxCategoryName in the list |
||
135 | * @Then the tax category :taxCategoryName should appear in the registry |
||
136 | */ |
||
137 | public function theTaxCategoryShouldAppearInTheRegistry(string $taxCategoryName): void |
||
144 | |||
145 | /** |
||
146 | * @Then I should not be able to edit its code |
||
147 | */ |
||
148 | public function iShouldNotBeAbleToEditItsCode(): void |
||
155 | |||
156 | /** |
||
157 | * @Then /^(this tax category) name should be "([^"]+)"$/ |
||
158 | * @Then /^(this tax category) should still be named "([^"]+)"$/ |
||
159 | */ |
||
160 | public function thisTaxCategoryNameShouldBe(TaxCategoryInterface $taxCategory, string $taxCategoryName): void |
||
165 | |||
166 | /** |
||
167 | * @Then I should be notified that tax category with this code already exists |
||
168 | */ |
||
169 | public function iShouldBeNotifiedThatTaxCategoryWithThisCodeAlreadyExists(): void |
||
173 | |||
174 | /** |
||
175 | * @Then there should still be only one tax category with :element :value |
||
176 | */ |
||
177 | public function thereShouldStillBeOnlyOneTaxCategoryWith(string $element, string $value): void |
||
182 | |||
183 | /** |
||
184 | * @Then I should be notified that :element is required |
||
185 | */ |
||
186 | public function iShouldBeNotifiedThatIsRequired(string $element): void |
||
190 | |||
191 | /** |
||
192 | * @Then tax category with :element :name should not be added |
||
193 | */ |
||
194 | public function taxCategoryWithNamedElementShouldNotBeAdded(string $element, string $name): void |
||
198 | |||
199 | /** |
||
200 | * @Then I should see a single tax category in the list |
||
201 | */ |
||
202 | public function iShouldSeeSingleTaxCategoryInTheList(): void |
||
206 | |||
207 | private function isItemOnIndex(string $property, string $value): bool |
||
213 | } |
||
214 |