|
1 | 1 | ..index:: |
2 | 2 | single: Emails; Testing |
3 | 3 |
|
4 | | -How to Test that an Email is Sent in afunctional Test |
| 4 | +How to Test that an Email is Sent in aFunctional Test |
5 | 5 | ====================================================== |
6 | 6 |
|
7 | | -Sendinge-mails with Symfony is pretty straightforward thanks to the |
| 7 | +Sendingemails with Symfony is pretty straightforward thanks to the |
8 | 8 | SwiftmailerBundle, which leverages the power of the `Swift Mailer`_ library. |
9 | 9 |
|
10 | 10 | To functionally test that an email was sent, and even assert the email subject, |
11 | 11 | content or any other headers, you can use:ref:`the Symfony Profiler<internals-profiler>`. |
12 | 12 |
|
13 | | -Start with an easy controller action that sends ane-mail:: |
| 13 | +Start with an easy controller action that sends anemail:: |
14 | 14 |
|
15 | 15 | public function sendEmailAction($name) |
16 | 16 | { |
@@ -49,13 +49,13 @@ to get information about the messages send on the previous request:: |
49 | 49 |
|
50 | 50 | $mailCollector = $client->getProfile()->getCollector('swiftmailer'); |
51 | 51 |
|
52 | | - // Check that ane-mail was sent |
| 52 | + // Check that anemail was sent |
53 | 53 | $this->assertEquals(1, $mailCollector->getMessageCount()); |
54 | 54 |
|
55 | 55 | $collectedMessages = $mailCollector->getMessages(); |
56 | 56 | $message = $collectedMessages[0]; |
57 | 57 |
|
58 | | - // Assertinge-mail data |
| 58 | + // Assertingemail data |
59 | 59 | $this->assertInstanceOf('Swift_Message', $message); |
60 | 60 | $this->assertEquals('Hello Email', $message->getSubject()); |
61 | 61 | $this->assertEquals('send@example.com', key($message->getFrom())); |
|