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

Commit 4c3e323

Browse files
committed
Add method for checking content type. Fixes #23.
1 parent c506410 commit 4c3e323

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/MailTracking.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,24 @@ protected function seeEmailContains($excerpt, Swift_Message $message = null)
134134
return $this;
135135
}
136136

137+
/**
138+
* Assert that the last email's content type equals the given text.
139+
* For example, "text/plain" and "text/html" are valid content types for an email.
140+
*
141+
* @param string $content_type
142+
* @param Swift_Message|null $message
143+
*
144+
* @return PHPUnit_Framework_TestCase $this
145+
*/
146+
protected function seeEmailContentTypeEquals($content_type, Swift_Message $message = null)
147+
{
148+
$this->assertEquals($content_type, $this->getEmail($message)
149+
->getContentType(),
150+
"The last email sent did not contain the provided body.");
151+
152+
return $this;
153+
}
154+
137155
/**
138156
* Assert that the last email's body does not contain the given text.
139157
*

0 commit comments

Comments
 (0)