@@ -172,18 +172,16 @@ public function iWantToModifyACatalogPromotion(CatalogPromotionInterface $catalo
172172 }
173173
174174 /**
175- * @When I add the percentage discount catalog promotion action configured with amount of :amount
175+ * @When it gives the : amount percentage discount
176176 */
177177 public function iAddThePercentageDiscountCatalogPromotionActionConfiguredWithAmountOf (string $ amount ): void
178178 {
179- $ actions = [
180- [
181- 'type ' => CatalogPromotionInterface::TYPE_PERCENTAGE_DISCOUNT ,
182- 'configuration ' => [
183- 'amount ' => $ amount
184- ],
179+ $ actions = [[
180+ 'type ' => CatalogPromotionActionInterface::TYPE_PERCENTAGE_DISCOUNT ,
181+ 'configuration ' => [
182+ 'amount ' => $ amount
185183 ],
186- ];
184+ ]] ;
187185
188186 $ this ->client ->addRequestData ('actions ' , $ actions );
189187 }
@@ -240,13 +238,13 @@ public function iWantCatalogPromotionToBeAppliedOn(CatalogPromotionInterface $ca
240238 }
241239
242240 /**
243- * @When /^I want ("[^"]+" catalog promotion) to have "([^"]+)" discount$/
241+ * @When /^I edit ("[^"]+" catalog promotion) to have "([^"]+)" discount$/
244242 */
245243 public function iWantPromotionToHaveDiscount (CatalogPromotionInterface $ catalogPromotion , string $ amount ): void
246244 {
247245 $ this ->client ->buildUpdateRequest ($ catalogPromotion ->getCode ());
248246 $ rules = [[
249- 'type ' => CatalogPromotionInterface ::TYPE_PERCENTAGE_DISCOUNT ,
247+ 'type ' => CatalogPromotionActionInterface ::TYPE_PERCENTAGE_DISCOUNT ,
250248 'configuration ' => [
251249 'amount ' => $ amount ,
252250 ],
@@ -266,14 +264,6 @@ public function thereShouldBeNewCatalogPromotionOnTheList(int $amount = 0): void
266264 Assert::count ($ this ->responseChecker ->getCollection ($ this ->client ->index ()), $ amount );
267265 }
268266
269- /**
270- * @Then I should be notified that it has been successfully created
271- */
272- public function iShouldBeNotifiedThatItHasBeenSuccessfullyCreated (): void
273- {
274- Assert::same ($ this ->client ->getLastResponse ()->getStatusCode (), 201 );
275- }
276-
277267 /**
278268 * @Then /^it should have "([^"]+)" discount$/
279269 */
@@ -292,7 +282,7 @@ public function itShouldHavePercentageDiscount(string $amount): void
292282 $ catalogPromotionAction = $ this ->responseChecker ->getResponseContent ($ this ->client ->getLastResponse ())['actions ' ][0 ];
293283
294284 Assert::same ($ amount , $ catalogPromotionAction ['configuration ' ]['amount ' ]);
295- Assert::same (CatalogPromotionInterface ::TYPE_PERCENTAGE_DISCOUNT , $ catalogPromotionAction ['type ' ]);
285+ Assert::same (CatalogPromotionActionInterface ::TYPE_PERCENTAGE_DISCOUNT , $ catalogPromotionAction ['type ' ]);
296286 }
297287
298288 /**
0 commit comments