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

Commit 96eedcc

Browse files
committed
Assertion for seeEmailDoesNotContain. Fixes #13
1 parent 95e1d8b commit 96eedcc

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/MailTracking.php

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

137+
/**
138+
* Assert that the last email's body does not contain the given text.
139+
*
140+
* @param string $excerpt
141+
* @param Swift_Message|null $message
142+
*
143+
* @return PHPUnit_Framework_TestCase $this
144+
*/
145+
protected function seeEmailDoesNotContain($excerpt, Swift_Message $message = null)
146+
{
147+
$this->assertNotContains($excerpt, $this->getEmail($message)
148+
->getBody(), "Email containing the provided text was found in the body.");
149+
150+
return $this;
151+
}
152+
137153
/**
138154
* Assert that the last email's body equals the given text.
139155
*

0 commit comments

Comments
 (0)