Skip to content
This repository was archived by the owner on Apr 8, 2024. It is now read-only.

Commit c506410

Browse files
committed
Merge pull request #22 from spinen/feature/renameSeeEmailsSent
Rename seeEmailsSent() to seeEmailCountEquals()
2 parents 7d41dc7 + 9a0c41c commit c506410

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ You mixin the assertions with the ```Spinen\MailAssertions\MailTracking``` trait
3232
* seeEmailBcc
3333
* seeEmailCc
3434
* seeEmailContains
35+
* seeEmailCountEquals
3536
* seeEmailDoesNotContain
3637
* seeEmailEquals
3738
* seeEmailFrom
@@ -42,7 +43,6 @@ You mixin the assertions with the ```Spinen\MailAssertions\MailTracking``` trait
4243
* seeEmailTo
4344
* seeEmailWasNotSent
4445
* seeEmailWasSent
45-
* seeEmailsSent
4646

4747
NOTE: If there was more than 1 email sent, then the assertions look at the last email.
4848

src/MailTracking.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,21 @@ protected function seeEmailReplyTo($reply_to, Swift_Message $message = null)
207207
* @param integer $count
208208
*
209209
* @return PHPUnit_Framework_TestCase $this
210+
* @deprecated in favor of seeEmailCountEquals
210211
*/
211212
protected function seeEmailsSent($count)
213+
{
214+
return $this->seeEmailCountEquals($count);
215+
}
216+
217+
/**
218+
* Assert that the given number of emails were sent.
219+
*
220+
* @param integer $count
221+
*
222+
* @return PHPUnit_Framework_TestCase $this
223+
*/
224+
protected function seeEmailCountEquals($count)
212225
{
213226
$emailsSent = count($this->emails);
214227

tests/MailTrackingTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,19 +223,19 @@ public function it_checks_email_reply_to_address()
223223
*/
224224
public function it_knows_how_many_emails_have_been_sent()
225225
{
226-
$this->assertEquals($this->mail_tracking, $this->callProtectedMethod('seeEmailsSent', [0]));
226+
$this->assertEquals($this->mail_tracking, $this->callProtectedMethod('seeEmailCountEquals', [0]));
227227

228228
$message = $this->makeMessage();
229229

230230
$this->mail_tracking->recordMail($message);
231231

232-
$this->assertEquals($this->mail_tracking, $this->callProtectedMethod('seeEmailsSent', [1]));
232+
$this->assertEquals($this->mail_tracking, $this->callProtectedMethod('seeEmailCountEquals', [1]));
233233

234234
$message = $this->makeMessage();
235235

236236
$this->mail_tracking->recordMail($message);
237237

238-
$this->assertEquals($this->mail_tracking, $this->callProtectedMethod('seeEmailsSent', [2]));
238+
$this->assertEquals($this->mail_tracking, $this->callProtectedMethod('seeEmailCountEquals', [2]));
239239
}
240240

241241
/**

0 commit comments

Comments
 (0)