|
@@ 18-28 (lines=11) @@
|
| 15 |
|
* |
| 16 |
|
* @BeforeScenario |
| 17 |
|
*/ |
| 18 |
|
public function disableMail($event) |
| 19 |
|
{ |
| 20 |
|
$tags = array_merge($event->getFeature()->getTags(), $event->getScenario()->getTags()); |
| 21 |
|
if (!in_array('sendmail', $tags) && !in_array('sendemail', $tags)) { |
| 22 |
|
$this->getMailManager()->disableMail(); |
| 23 |
|
// Always reset mail count, in case the default mail manager is being used |
| 24 |
|
// which enables mail collecting automatically when mail is disabled, making |
| 25 |
|
//the use of the @mail tag optional in this case. |
| 26 |
|
$this->mailCount = []; |
| 27 |
|
} |
| 28 |
|
} |
| 29 |
|
|
| 30 |
|
/** |
| 31 |
|
* Restore mail sending. |
|
@@ 35-41 (lines=7) @@
|
| 32 |
|
* |
| 33 |
|
* @AfterScenario |
| 34 |
|
*/ |
| 35 |
|
public function enableMail($event) |
| 36 |
|
{ |
| 37 |
|
$tags = array_merge($event->getFeature()->getTags(), $event->getScenario()->getTags()); |
| 38 |
|
if (!in_array('sendmail', $tags) && !in_array('sendemail', $tags)) { |
| 39 |
|
$this->getMailManager()->enableMail(); |
| 40 |
|
} |
| 41 |
|
} |
| 42 |
|
|
| 43 |
|
/** |
| 44 |
|
* Allow opting in to mail collection. When using the default mail manager |