diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-01-20 17:43:10 +0100 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-01-21 11:03:27 +0100 |
commit | abd454c45633e335d9d63bcd250e760b968f8138 (patch) | |
tree | a616f79e642b9683b3c7b597ed9c4072c0af5cdf /src/Wallabag/UserBundle/Tests/Mailer/AuthCodeMailerTest.php | |
parent | 5f736213af209b0457e4e9d62f06fd5f46652f5f (diff) | |
download | wallabag-abd454c45633e335d9d63bcd250e760b968f8138.tar.gz wallabag-abd454c45633e335d9d63bcd250e760b968f8138.tar.zst wallabag-abd454c45633e335d9d63bcd250e760b968f8138.zip |
Update HTML 2FA template
Split paragraph in translation
Inject wallabag_url for image in HTML template
Remove username & password from config_dev.yml (null are already the default value)
Diffstat (limited to 'src/Wallabag/UserBundle/Tests/Mailer/AuthCodeMailerTest.php')
-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 | } |