@@ -21,7 +21,7 @@ |
||
21 | 21 | /** |
22 | 22 | * MailRecorder constructor. |
23 | 23 | * |
24 | - * @param $test |
|
24 | + * @param MailTracking $test |
|
25 | 25 | */ |
26 | 26 | public function __construct($test) |
27 | 27 | { |
@@ -46,13 +46,13 @@ discard block |
||
46 | 46 | * |
47 | 47 | * @before |
48 | 48 | */ |
49 | - public function setUpMailTracking() |
|
50 | - { |
|
51 | - $this->afterApplicationCreated(function() { |
|
52 | - Mail::getSwiftMailer() |
|
53 | - ->registerPlugin(new MailRecorder($this)); |
|
54 | - }); |
|
55 | - } |
|
49 | + public function setUpMailTracking() |
|
50 | + { |
|
51 | + $this->afterApplicationCreated(function() { |
|
52 | + Mail::getSwiftMailer() |
|
53 | + ->registerPlugin(new MailRecorder($this)); |
|
54 | + }); |
|
55 | + } |
|
56 | 56 | |
57 | 57 | /** |
58 | 58 | * Retrieve the appropriate Swift message. |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | protected function seeEmailBcc($bcc, Swift_Message $message = null) |
100 | 100 | { |
101 | 101 | $this->assertArrayHasKey($bcc, (array)$this->getEmail($message) |
102 | - ->getBcc(), "The last email sent was not bcc'ed to $bcc."); |
|
102 | + ->getBcc(), "The last email sent was not bcc'ed to $bcc."); |
|
103 | 103 | |
104 | 104 | return $this; |
105 | 105 | } |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | protected function seeEmailCc($cc, Swift_Message $message = null) |
116 | 116 | { |
117 | 117 | $this->assertArrayHasKey($cc, (array)$this->getEmail($message) |
118 | - ->getCc(), "The last email sent was not cc'ed to $cc."); |
|
118 | + ->getCc(), "The last email sent was not cc'ed to $cc."); |
|
119 | 119 | |
120 | 120 | return $this; |
121 | 121 | } |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | protected function seeEmailContains($excerpt, Swift_Message $message = null) |
132 | 132 | { |
133 | 133 | $this->assertContains($excerpt, $this->getEmail($message) |
134 | - ->getBody(), "The last email sent did not contain the provided body."); |
|
134 | + ->getBody(), "The last email sent did not contain the provided body."); |
|
135 | 135 | |
136 | 136 | return $this; |
137 | 137 | } |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | { |
167 | 167 | $this->assertNotContains($excerpt, $this->getEmail($message) |
168 | 168 | ->getBody(), |
169 | - "The last email sent contained the provided text in its body."); |
|
169 | + "The last email sent contained the provided text in its body."); |
|
170 | 170 | |
171 | 171 | return $this; |
172 | 172 | } |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | { |
200 | 200 | // TODO: Allow from to be an array to check email & name |
201 | 201 | $this->assertArrayHasKey($sender, (array)$this->getEmail($message) |
202 | - ->getFrom(), "The last email sent was not sent from $sender."); |
|
202 | + ->getFrom(), "The last email sent was not sent from $sender."); |
|
203 | 203 | |
204 | 204 | return $this; |
205 | 205 | } |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | { |
237 | 237 | $this->assertArrayHasKey($reply_to, (array)$this->getEmail($message) |
238 | 238 | ->getReplyTo(), |
239 | - "The last email sent was not set to reply to $reply_to."); |
|
239 | + "The last email sent was not set to reply to $reply_to."); |
|
240 | 240 | |
241 | 241 | return $this; |
242 | 242 | } |
@@ -295,8 +295,8 @@ discard block |
||
295 | 295 | protected function seeEmailSubjectContains($excerpt, Swift_Message $message = null) |
296 | 296 | { |
297 | 297 | $this->assertContains($excerpt, $this->getEmail($message) |
298 | - ->getSubject(), |
|
299 | - "The last email sent did not contain the provided subject."); |
|
298 | + ->getSubject(), |
|
299 | + "The last email sent did not contain the provided subject."); |
|
300 | 300 | |
301 | 301 | return $this; |
302 | 302 | } |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | { |
314 | 314 | $this->assertNotContains($excerpt, $this->getEmail($message) |
315 | 315 | ->getSubject(), |
316 | - "The last email sent contained the provided text in its subject."); |
|
316 | + "The last email sent contained the provided text in its subject."); |
|
317 | 317 | |
318 | 318 | return $this; |
319 | 319 | } |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | protected function seeEmailSubjectEquals($subject, Swift_Message $message = null) |
330 | 330 | { |
331 | 331 | $this->assertEquals($subject, $this->getEmail($message) |
332 | - ->getSubject(), |
|
332 | + ->getSubject(), |
|
333 | 333 | "The last email sent did not contain a subject of $subject."); |
334 | 334 | |
335 | 335 | return $this; |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | protected function seeEmailTo($recipient, Swift_Message $message = null) |
347 | 347 | { |
348 | 348 | $this->assertArrayHasKey($recipient, (array)$this->getEmail($message) |
349 | - ->getTo(), "The last email sent was not sent to $recipient."); |
|
349 | + ->getTo(), "The last email sent was not sent to $recipient."); |
|
350 | 350 | |
351 | 351 | return $this; |
352 | 352 | } |