1 | <?php |
||
25 | final class PromotionCouponContext implements Context |
||
26 | { |
||
27 | /** |
||
28 | * @var SharedStorageInterface |
||
29 | */ |
||
30 | private $sharedStorage; |
||
31 | |||
32 | /** |
||
33 | * @var CouponRepositoryInterface |
||
34 | */ |
||
35 | private $couponRepository; |
||
36 | |||
37 | /** |
||
38 | * @param SharedStorageInterface $sharedStorage |
||
39 | * @param CouponRepositoryInterface $couponRepository |
||
40 | */ |
||
41 | public function __construct(SharedStorageInterface $sharedStorage, CouponRepositoryInterface $couponRepository) |
||
46 | |||
47 | /** |
||
48 | * @When /^I try to delete ("[^"]+" coupon) related to (this promotion)$/ |
||
49 | */ |
||
50 | public function iTryToDeleteCoupon(CouponInterface $coupon, PromotionInterface $promotion) |
||
61 | |||
62 | /** |
||
63 | * @When /^I delete ("[^"]+" coupon) related to (this promotion)$/ |
||
64 | */ |
||
65 | public function iDeleteCouponRelatedTo(CouponInterface $coupon, PromotionInterface $promotion) |
||
71 | |||
72 | /** |
||
73 | * @Then /^(this coupon) should no longer exist in the coupon registry$/ |
||
74 | */ |
||
75 | public function couponShouldNotExistInTheRegistry(CouponInterface $coupon) |
||
82 | |||
83 | /** |
||
84 | * @Then I should be notified that it is in use and cannot be deleted |
||
85 | */ |
||
86 | public function iShouldBeNotifiedOfFailure() |
||
92 | |||
93 | /** |
||
94 | * @Then /^([^"]+) should still exist in the registry$/ |
||
95 | */ |
||
96 | public function couponShouldStillExistInTheRegistry(CouponInterface $coupon) |
||
103 | |||
104 | /** |
||
105 | * @Then I should be notified that it has been successfully deleted |
||
106 | */ |
||
107 | public function iShouldBeNotifiedOfSuccess() |
||
111 | |||
112 | /** |
||
113 | * @Given I am logged in as an administrator |
||
114 | */ |
||
115 | public function iAmLoggedInAsAnAdministrator() |
||
119 | } |
||
120 |