1 | <?php |
||
25 | final class PromotionContext implements Context |
||
26 | { |
||
27 | /** |
||
28 | * @var SharedStorageInterface |
||
29 | */ |
||
30 | private $sharedStorage; |
||
31 | |||
32 | /** |
||
33 | * @var PromotionRepositoryInterface |
||
34 | */ |
||
35 | private $promotionRepository; |
||
36 | |||
37 | /** |
||
38 | * @var RepositoryInterface |
||
39 | */ |
||
40 | private $couponRepository; |
||
41 | |||
42 | /** |
||
43 | * @param SharedStorageInterface $sharedStorage |
||
44 | * @param PromotionRepositoryInterface $promotionRepository |
||
45 | * @param RepositoryInterface $couponRepository |
||
46 | */ |
||
47 | public function __construct( |
||
56 | |||
57 | /** |
||
58 | * @When /^I try to delete ("([^"]+)" coupon)$/ |
||
59 | */ |
||
60 | public function iTryToDeleteCoupon(CouponInterface $coupon) |
||
70 | |||
71 | /** |
||
72 | * @When /^I delete ("([^"]+)" coupon)$/ |
||
73 | */ |
||
74 | public function iDeleteCoupon(CouponInterface $coupon) |
||
79 | |||
80 | /** |
||
81 | * @Then /^([^"]+ should no longer) exist in the coupon registry$/ |
||
82 | */ |
||
83 | public function couponShouldNotExistInTheRegistry($couponId) |
||
87 | |||
88 | /** |
||
89 | * @Then I should be notified that it is in use and cannot be deleted |
||
90 | */ |
||
91 | public function iShouldBeNotifiedOfFailure() |
||
97 | |||
98 | /** |
||
99 | * @Then /^([^"]+) should still exist in the registry$/ |
||
100 | */ |
||
101 | public function couponShouldStillExistInTheRegistry(CouponInterface $coupon) |
||
105 | |||
106 | /** |
||
107 | * @When /^I try to delete (promotion "([^"]+)")$/ |
||
108 | */ |
||
109 | public function iTryToDeletePromotion(PromotionInterface $promotion) |
||
119 | |||
120 | /** |
||
121 | * @When /^I delete (promotion "([^"]+)")$/ |
||
122 | */ |
||
123 | public function iDeletePromotion(PromotionInterface $promotion) |
||
128 | |||
129 | /** |
||
130 | * @Then /^([^"]+ should no longer) exist in the promotion registry$/ |
||
131 | */ |
||
132 | public function promotionShouldNotExistInTheRegistry($promotionId) |
||
136 | |||
137 | /** |
||
138 | * @Then promotion :promotion should still exist in the registry |
||
139 | */ |
||
140 | public function promotionShouldStillExistInTheRegistry(PromotionInterface $promotion) |
||
144 | |||
145 | /** |
||
146 | * @Then I should be notified that it has been successfully deleted |
||
147 | */ |
||
148 | public function iShouldBeNotifiedOfSuccess() |
||
152 | } |
||
153 |