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

Commit 0789209

Browse files
committed
Add method to check email priority. Fixes #7.
1 parent c0e9323 commit 0789209

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/MailTracking.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,25 @@ protected function seeEmailFrom($sender, Swift_Message $message = null)
181181
$this->assertArrayHasKey($sender, (array)$this->getEmail($message)
182182
->getFrom(), "The last email sent was not sent from $sender.");
183183

184+
return $this;
185+
}
186+
187+
/**
188+
* Assert that the last email had the given priority level.
189+
* The value is an integer where 1 is the highest priority and 5 is the lowest.
190+
*
191+
* @param integer $priority
192+
* @param Swift_Message|null $message
193+
*
194+
* @return PHPUnit_Framework_TestCase $this
195+
*/
196+
protected function seeEmailPriorityEquals($priority, Swift_Message $message = null)
197+
{
198+
$actual_priority = $this->getEmail($message)
199+
->getPriority();
200+
201+
$this->assertEquals($priority, $actual_priority, "The last email sent had a priority of $actual_priority but expected $priority.");
202+
184203
return $this;
185204
}
186205

0 commit comments

Comments
 (0)