1 | <?php |
||
10 | class MailContext extends RawMailContext { |
||
11 | |||
12 | /** |
||
13 | * By default, prevent mail from being actually sent out during tests. |
||
14 | * |
||
15 | * @BeforeScenario |
||
16 | */ |
||
17 | public function disableMail($event) { |
||
27 | |||
28 | /** |
||
29 | * Restore mail sending. |
||
30 | * |
||
31 | * @AfterScenario |
||
32 | */ |
||
33 | public function enableMail($event) { |
||
39 | |||
40 | /** |
||
41 | * Allow opting in to mail collection. When using the default mail manager |
||
42 | * service, it is not necessary to use this tag. |
||
43 | * |
||
44 | * @BeforeScenario @mail @email |
||
45 | */ |
||
46 | public function collectMail() { |
||
49 | |||
50 | /** |
||
51 | * Stop collecting mail at scenario end. |
||
52 | * |
||
53 | * @AfterScenario @mail @email |
||
54 | */ |
||
55 | public function stopCollectingMail() { |
||
58 | |||
59 | /** |
||
60 | * This is mainly useful for testing this context. |
||
61 | * |
||
62 | * @When Drupal sends a/an (e)mail: |
||
63 | */ |
||
64 | public function DrupalSendsMail(TableNode $fields) { |
||
76 | |||
77 | /** |
||
78 | * Check all mail sent during the scenario. |
||
79 | * |
||
80 | * @Then (a )(an )(e)mail(s) has/have been sent: |
||
81 | * @Then (a )(an )(e)mail(s) has/have been sent to :to: |
||
82 | * @Then (a )(an )(e)mail(s) has/have been sent with the subject :subject: |
||
83 | * @Then (a )(an )(e)mail(s) has/have been sent to :to with the subject :subject: |
||
84 | */ |
||
85 | public function mailHasBeenSent(TableNode $expectedMailTable, $to = '', $subject = '') { |
||
90 | |||
91 | /** |
||
92 | * Check mail sent since the last step that checked mail. |
||
93 | * |
||
94 | * @Then (a )(an )new (e)mail(s) is/are sent: |
||
95 | * @Then (a )(an )new (e)mail(s) is/are sent to :to: |
||
96 | * @Then (a )(an )new (e)mail(s) is/are sent with the subject :subject: |
||
97 | * @Then (a )(an )new (e)mail(s) is/are sent to :to with the subject :subject: |
||
98 | */ |
||
99 | public function newMailIsSent(TableNode $expectedMailTable, $to = '', $subject = '') { |
||
104 | |||
105 | /** |
||
106 | * Check all mail sent during the scenario. |
||
107 | * |
||
108 | * @Then :count (e)mail(s) has/have been sent |
||
109 | * @Then :count (e)mail(s) has/have been sent to :to |
||
110 | * @Then :count (e)mail(s) has/have been sent with the subject :subject |
||
111 | * @Then :count (e)mail(s) has/have been sent to :to with the subject :subject |
||
112 | */ |
||
113 | public function noMailHasBeenSent($count, $to = '', $subject = '') { |
||
120 | |||
121 | /** |
||
122 | * Check mail sent since the last step that checked mail. |
||
123 | * |
||
124 | * @Then :count new (e)mail(s) is/are sent |
||
125 | * @Then :count new (e)mail(s) is/are sent to :to |
||
126 | * @Then :count new (e)mail(s) is/are sent with the subject :subject |
||
127 | * @Then :count new (e)mail(s) is/are sent to :to with the subject :subject |
||
128 | */ |
||
129 | public function noNewMailIsSent($count, $to = '', $subject = '') { |
||
136 | |||
137 | /** |
||
138 | * @When I follow the link to :urlFragment from the (e)mail |
||
139 | * @When I follow the link to :urlFragment from the (e)mail to :to |
||
140 | * @When I follow the link to :urlFragment from the (e)mail with the subject :subject |
||
141 | * @When I follow the link to :urlFragment from the (e)mail to :to with the subject :subject |
||
142 | */ |
||
143 | public function followLinkInMail($urlFragment, $to = '', $subject = '') { |
||
169 | |||
170 | } |
||
171 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.