Skip to content

Commit e0f778f

Browse files
committed
Add method to delete sent emails during tests
1 parent 7befe47 commit e0f778f

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

src/Codeception/Lib/Connector/Yii2.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,15 @@ public function getEmails()
207207
return $this->emails;
208208
}
209209

210+
/**
211+
* Deletes all stored emails.
212+
* @internal
213+
*/
214+
public function clearEmails()
215+
{
216+
$this->emails = [];
217+
}
218+
210219
/**
211220
* @internal
212221
*/

src/Codeception/Module/Yii2.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -804,6 +804,15 @@ public function grabLastSentEmail()
804804
return end($messages);
805805
}
806806

807+
/**
808+
* Deletes all sent emails.
809+
* @part email
810+
*/
811+
public function deleteSentEmails()
812+
{
813+
$this->client->clearEmails();
814+
}
815+
807816

808817

809818
/**

0 commit comments

Comments
 (0)