diff options
Diffstat (limited to 'src/Wallabag/UserBundle/Tests/Mailer')
-rw-r--r-- | src/Wallabag/UserBundle/Tests/Mailer/AuthCodeMailerTest.php | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/Wallabag/UserBundle/Tests/Mailer/AuthCodeMailerTest.php b/src/Wallabag/UserBundle/Tests/Mailer/AuthCodeMailerTest.php index fbd7fdd7..e3f43a7e 100644 --- a/src/Wallabag/UserBundle/Tests/Mailer/AuthCodeMailerTest.php +++ b/src/Wallabag/UserBundle/Tests/Mailer/AuthCodeMailerTest.php | |||
@@ -36,11 +36,13 @@ class AuthCodeMailerTest extends \PHPUnit_Framework_TestCase | |||
36 | ); | 36 | ); |
37 | $this->mailer = new \Swift_Mailer($transport); | 37 | $this->mailer = new \Swift_Mailer($transport); |
38 | 38 | ||
39 | $this->twig = new \Twig_Environment(new \Twig_Loader_Array(array('@WallabagUserBundle/Resources/views/TwoFactor/email_auth_code.html.twig' => ' | 39 | $twigTemplate = <<<TWIG |
40 | {% block subject %}subject{% endblock %} | 40 | {% block subject %}subject{% endblock %} |
41 | {% block body_html %}html body{% endblock %} | 41 | {% block body_html %}html body {{ code }}{% endblock %} |
42 | {% block body_text %}text body{% endblock %} | 42 | {% block body_text %}text body {{ support_url }}{% endblock %} |
43 | '))); | 43 | TWIG; |
44 | |||
45 | $this->twig = new \Twig_Environment(new \Twig_Loader_Array(array('@WallabagUserBundle/Resources/views/TwoFactor/email_auth_code.html.twig' => $twigTemplate))); | ||
44 | } | 46 | } |
45 | 47 | ||
46 | public function testSendEmail() | 48 | public function testSendEmail() |
@@ -56,6 +58,7 @@ class AuthCodeMailerTest extends \PHPUnit_Framework_TestCase | |||
56 | $this->twig, | 58 | $this->twig, |
57 | 'nobody@test.io', | 59 | 'nobody@test.io', |
58 | 'wallabag test', | 60 | 'wallabag test', |
61 | 'http://0.0.0.0/support', | ||
59 | 'http://0.0.0.0' | 62 | 'http://0.0.0.0' |
60 | ); | 63 | ); |
61 | 64 | ||
@@ -67,7 +70,7 @@ class AuthCodeMailerTest extends \PHPUnit_Framework_TestCase | |||
67 | $this->assertArrayHasKey('test@wallabag.io', $msg->getTo()); | 70 | $this->assertArrayHasKey('test@wallabag.io', $msg->getTo()); |
68 | $this->assertEquals(array('nobody@test.io' => 'wallabag test'), $msg->getFrom()); | 71 | $this->assertEquals(array('nobody@test.io' => 'wallabag test'), $msg->getFrom()); |
69 | $this->assertEquals('subject', $msg->getSubject()); | 72 | $this->assertEquals('subject', $msg->getSubject()); |
70 | $this->assertContains('text body', $msg->toString()); | 73 | $this->assertContains('text body http://0.0.0.0/support', $msg->toString()); |
71 | $this->assertContains('html body', $msg->toString()); | 74 | $this->assertContains('html body 666666', $msg->toString()); |
72 | } | 75 | } |
73 | } | 76 | } |