1 | <?php |
||
24 | final class EmailContext implements Context |
||
25 | { |
||
26 | /** |
||
27 | * @var SharedStorageInterface |
||
28 | */ |
||
29 | private $sharedStorage; |
||
30 | |||
31 | /** |
||
32 | * @var EmailCheckerInterface |
||
33 | */ |
||
34 | private $emailChecker; |
||
35 | |||
36 | /** |
||
37 | * @param SharedStorageInterface $sharedStorage |
||
38 | * @param EmailCheckerInterface $emailChecker |
||
39 | */ |
||
40 | public function __construct(SharedStorageInterface $sharedStorage, EmailCheckerInterface $emailChecker) |
||
45 | |||
46 | /** |
||
47 | * @Then it should be sent to :recipient |
||
48 | * @Then the email with reset token should be sent to :recipient |
||
49 | */ |
||
50 | public function anEmailShouldBeSentTo($recipient) |
||
57 | |||
58 | /** |
||
59 | * @Then :count email(s) should be sent to :recipient |
||
60 | */ |
||
61 | public function numberOfEmailsShouldBeSentTo($count, $recipient) |
||
75 | |||
76 | /** |
||
77 | * @Then a welcoming email should have been sent to :recipient |
||
78 | */ |
||
79 | public function aWelcomingEmailShouldHaveBeenSentTo($recipient) |
||
83 | |||
84 | /** |
||
85 | * @Then /^an email with the summary of (order placed by "([^"]+)") should be sent to him$/ |
||
86 | */ |
||
87 | public function anEmailWithOrderConfirmationShouldBeSentTo(OrderInterface $order) |
||
97 | |||
98 | /** |
||
99 | * @Then /^an email with shipment's details of (this order) should be sent to "([^"]+)"$/ |
||
100 | */ |
||
101 | public function anEmailWithShipmentDetailsOfOrderShouldBeSentTo(OrderInterface $order, $recipient) |
||
109 | |||
110 | /** |
||
111 | * @param string $message |
||
112 | * @param string $recipient |
||
113 | */ |
||
114 | private function assertEmailContainsMessageTo($message, $recipient) |
||
121 | |||
122 | /** |
||
123 | * @param OrderInterface $order |
||
124 | * |
||
125 | * @return string |
||
126 | */ |
||
127 | private function getShippingMethodName(OrderInterface $order) |
||
137 | } |
||
138 |