1 | <?php |
||
21 | final class ManagingCustomerGroupsContext 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 customer group |
||
33 | */ |
||
34 | public function iWantToCreateANewCustomerGroup(): void |
||
38 | |||
39 | /** |
||
40 | * @When I specify its code as :code |
||
41 | * @When I do not specify its code |
||
42 | */ |
||
43 | public function iSpecifyItsCodeAs(?string $code = null): void |
||
49 | |||
50 | /** |
||
51 | * @When I specify its name as :name |
||
52 | */ |
||
53 | public function iSpecifyItsNameAs(string $name): void |
||
57 | |||
58 | /** |
||
59 | * @When I remove its name |
||
60 | */ |
||
61 | public function iRemoveItsName(): void |
||
65 | |||
66 | /** |
||
67 | * @When I add it |
||
68 | * @When I try to add it |
||
69 | */ |
||
70 | public function iAddIt() |
||
74 | |||
75 | /** |
||
76 | * @When /^I want to edit (this customer group)$/ |
||
77 | */ |
||
78 | public function iWantToEditThisCustomerGroup(CustomerGroupInterface $customerGroup): void |
||
82 | |||
83 | /** |
||
84 | * @When I save my changes |
||
85 | * @When I try to save my changes |
||
86 | */ |
||
87 | public function iSaveMyChanges(): void |
||
91 | |||
92 | /** |
||
93 | * @When I browse customer groups |
||
94 | * @When I want to browse customer groups |
||
95 | */ |
||
96 | public function iWantToBrowseCustomerGroups(): void |
||
100 | |||
101 | /** |
||
102 | * @When I delete the :customerGroup customer group |
||
103 | */ |
||
104 | public function iDeleteTheCustomerGroup(CustomerGroupInterface $customerGroup): void |
||
108 | |||
109 | /** |
||
110 | * @Then the customer group :customerGroup should appear in the store |
||
111 | */ |
||
112 | public function theCustomerGroupShouldAppearInTheStore(CustomerGroupInterface $customerGroup): void |
||
120 | |||
121 | /** |
||
122 | * @Then this customer group with name :name should appear in the store |
||
123 | * @Then I should see the customer group :name in the list |
||
124 | */ |
||
125 | public function thisCustomerGroupWithNameShouldAppearInTheStore(string $name): void |
||
133 | |||
134 | /** |
||
135 | * @Then I should see a single customer group in the list |
||
136 | * @Then I should see :amountOfCustomerGroups customer groups in the list |
||
137 | */ |
||
138 | public function iShouldSeeCustomerGroupsInTheList(int $amountOfCustomerGroups = 1): void |
||
143 | |||
144 | /** |
||
145 | * @Then /^(this customer group) should still be named "([^"]+)"$/ |
||
146 | */ |
||
147 | public function thisCustomerGroupShouldStillBeNamed(CustomerGroupInterface $customerGroup, string $name): void |
||
152 | |||
153 | /** |
||
154 | * @Then I should be notified that name is required |
||
155 | */ |
||
156 | public function iShouldBeNotifiedThatNameIsRequired(): void |
||
160 | |||
161 | /** |
||
162 | * @Then I should be notified that customer group with this code already exists |
||
163 | */ |
||
164 | public function iShouldBeNotifiedThatCustomerGroupWithThisCodeAlreadyExists(): void |
||
168 | |||
169 | /** |
||
170 | * @Then I should be informed that this form contains errors |
||
171 | */ |
||
172 | public function iShouldBeInformedThatThisFormContainsErrors(): void |
||
176 | |||
177 | /** |
||
178 | * @Then I should not be able to edit its code |
||
179 | */ |
||
180 | public function iShouldNotBeAbleToEditItsCode(): void |
||
187 | |||
188 | /** |
||
189 | * @Then /^(this customer group) should no longer exist in the registry$/ |
||
190 | */ |
||
191 | public function thisCustomerGroupShouldNoLongerExistInTheRegistry(CustomerGroupInterface $customerGroup) |
||
196 | |||
197 | private function isItemOnIndex(string $property, string $value): bool |
||
203 | } |
||
204 |