Merge pull request #1645 from wallabag/v2-fix-loadtemplate-sendemail

Fix #1643: fix the way to load the HTML template in 2factor auth
This commit is contained in:
Jeremy Benoist 2016-02-04 17:45:26 +01:00
commit eb3e3969a2
3 changed files with 4 additions and 4 deletions

View file

@ -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
{

View file

@ -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', [

View file

@ -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()