1 | <?php |
||
25 | final class ManagingPaymentsContext implements Context |
||
26 | { |
||
27 | /** @var IndexPageInterface */ |
||
28 | private $indexPage; |
||
29 | |||
30 | /** @var ShowPageInterface */ |
||
31 | private $orderShowPage; |
||
32 | |||
33 | /** @var NotificationCheckerInterface */ |
||
34 | private $notificationChecker; |
||
35 | |||
36 | public function __construct( |
||
45 | |||
46 | /** |
||
47 | * @When I browse payments |
||
48 | * @Given I am browsing payments |
||
49 | */ |
||
50 | public function iAmBrowsingPayments(): void |
||
54 | |||
55 | /** |
||
56 | * @When I choose :paymentState as a payment state |
||
57 | */ |
||
58 | public function iChooseAsAPaymentState(string $paymentState): void |
||
62 | |||
63 | /** |
||
64 | * @When I complete the payment of order :orderNumber |
||
65 | */ |
||
66 | public function iCompleteThePaymentOfOrder(string $orderNumber): void |
||
70 | |||
71 | /** |
||
72 | * @When I filter |
||
73 | */ |
||
74 | public function iFilter(): void |
||
78 | |||
79 | /** |
||
80 | * @When I go to the details of the first payment's order |
||
81 | */ |
||
82 | public function iGoToTheDetailsOfTheFirstPaymentSOrder(): void |
||
86 | |||
87 | /** |
||
88 | * @When I choose :channelName as a channel filter |
||
89 | */ |
||
90 | public function iChooseChannelAsAChannelFilter(string $channelName): void |
||
94 | |||
95 | /** |
||
96 | * @Then I should see :count payments in the list |
||
97 | * @Then I should see a single payment in the list |
||
98 | */ |
||
99 | public function iShouldSeePaymentsInTheList(int $count = 1): void |
||
103 | |||
104 | /** |
||
105 | * @Then the payment of the :orderNumber order should be :paymentState for :customer |
||
106 | */ |
||
107 | public function thePaymentOfTheOrderShouldBeFor( |
||
108 | string $orderNumber, |
||
109 | string $paymentState, |
||
110 | CustomerInterface $customer |
||
111 | ): void { |
||
112 | $parameters = [ |
||
113 | 'number' => $orderNumber, |
||
114 | 'state' => $paymentState, |
||
115 | 'customer' => $customer->getEmail(), |
||
116 | ]; |
||
117 | |||
118 | Assert::true($this->indexPage->isSingleResourceOnPage($parameters)); |
||
119 | } |
||
120 | |||
121 | /** |
||
122 | * @Then I should see order page with details of order :order |
||
123 | */ |
||
124 | public function iShouldSeeOrderPageWithDetailsOfOrder(OrderInterface $order): void |
||
128 | |||
129 | /** |
||
130 | * @Then I should see (also) the payment of the :orderNumber order |
||
131 | */ |
||
132 | public function iShouldSeeThePaymentOfTheOrder(string $orderNumber): void |
||
136 | |||
137 | /** |
||
138 | * @Then I should see the payment of order :orderNumber as :paymentState |
||
139 | */ |
||
140 | public function iShouldSeeThePaymentOfOrderAs(string $orderNumber, string $paymentState): void |
||
144 | |||
145 | /** |
||
146 | * @Then I should be notified that the payment has been completed |
||
147 | */ |
||
148 | public function iShouldBeNotifiedThatThePaymentHasBeenCompleted(): void |
||
152 | |||
153 | /** |
||
154 | * @Then I should not see a payment of order :orderNumber |
||
155 | * @Then I should not see the payment of the :orderNumber order |
||
156 | */ |
||
157 | public function iShouldNotSeeAPaymentOfOrder(string $orderNumber): void |
||
161 | |||
162 | /** |
||
163 | * @Then /^I should see payment for (the "[^"]+" order) as (\d+)(?:|st|nd|rd|th) in the list$/ |
||
164 | */ |
||
165 | public function iShouldSeePaymentForTheOrderInTheList(string $orderNumber, int $position): void |
||
169 | } |
||
170 |