From 855a4c680f4cb12f64999db2ff58cfb0bdc0614d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= <nicolas.loeuillet@smile.fr>
Date: Thu, 4 Feb 2016 17:29:14 +0100
Subject: [PATCH] Fix #1643: fix the way to load the HTML template in 2factor
 auth

---
 .../CoreBundle/Tests/Controller/SettingsControllerTest.php    | 2 +-
 src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php             | 4 ++--
 src/Wallabag/UserBundle/Tests/Mailer/AuthCodeMailerTest.php   | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/Wallabag/CoreBundle/Tests/Controller/SettingsControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/SettingsControllerTest.php
index 354aedbac..fd698b3e4 100644
--- a/src/Wallabag/CoreBundle/Tests/Controller/SettingsControllerTest.php
+++ b/src/Wallabag/CoreBundle/Tests/Controller/SettingsControllerTest.php
@@ -6,7 +6,7 @@ use Wallabag\CoreBundle\Tests\WallabagCoreTestCase;
 
 /**
  * The controller `SettingsController` does not exist.
- * This test cover security against the internal settings page managed by CraueConfigBundle
+ * This test cover security against the internal settings page managed by CraueConfigBundle.
  */
 class SettingsControllerTest extends WallabagCoreTestCase
 {
diff --git a/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php b/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php
index 98017f43a..d8403491f 100644
--- a/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php
+++ b/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php
@@ -48,7 +48,7 @@ class AuthCodeMailer implements AuthCodeMailerInterface
     private $supportUrl;
 
     /**
-     * Url for the wallabag instance (only used for image in the HTML email template)
+     * Url for the wallabag instance (only used for image in the HTML email template).
      *
      * @var string
      */
@@ -80,7 +80,7 @@ class AuthCodeMailer implements AuthCodeMailerInterface
      */
     public function sendAuthCode(TwoFactorInterface $user)
     {
-        $template = $this->twig->loadTemplate('@WallabagUserBundle/Resources/views/TwoFactor/email_auth_code.html.twig');
+        $template = $this->twig->loadTemplate('WallabagUserBundle:TwoFactor:email_auth_code.html.twig');
 
         $subject = $template->renderBlock('subject', array());
         $bodyHtml = $template->renderBlock('body_html', [
diff --git a/src/Wallabag/UserBundle/Tests/Mailer/AuthCodeMailerTest.php b/src/Wallabag/UserBundle/Tests/Mailer/AuthCodeMailerTest.php
index 562a1ed2b..b95e195e6 100644
--- a/src/Wallabag/UserBundle/Tests/Mailer/AuthCodeMailerTest.php
+++ b/src/Wallabag/UserBundle/Tests/Mailer/AuthCodeMailerTest.php
@@ -43,7 +43,7 @@ class AuthCodeMailerTest extends \PHPUnit_Framework_TestCase
 {% block body_text %}text body {{ support_url }}{% endblock %}
 TWIG;
 
-        $this->twig = new \Twig_Environment(new \Twig_Loader_Array(array('@WallabagUserBundle/Resources/views/TwoFactor/email_auth_code.html.twig' => $twigTemplate)));
+        $this->twig = new \Twig_Environment(new \Twig_Loader_Array(array('WallabagUserBundle:TwoFactor:email_auth_code.html.twig' => $twigTemplate)));
 
         $this->config = $this->getMockBuilder('Craue\ConfigBundle\Util\Config')
             ->disableOriginalConstructor()