From cf73b64556c48fe29614ff6723d6f18ced508244 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sat, 21 Apr 2012 19:43:26 +0200 Subject: [PATCH] added unit tests to prove the issue with the current introspection exception code --- test/Twig/Tests/ErrorTest.php | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/test/Twig/Tests/ErrorTest.php b/test/Twig/Tests/ErrorTest.php index 978ee80..d0e48be 100644 --- a/test/Twig/Tests/ErrorTest.php +++ b/test/Twig/Tests/ErrorTest.php @@ -29,7 +29,7 @@ class Twig_Tests_ErrorTest extends PHPUnit_Framework_TestCase public function testTwigExceptionAddsFileAndLineWhenMissing() { - $loader = new Twig_Loader_Array(array('index' => "\n\n{{ foo.bar }}")); + $loader = new Twig_Loader_Array(array('index' => "\n\n{{ foo.bar }}\n\n\n{{ 'foo' }}")); $twig = new Twig_Environment($loader, array('strict_variables' => true, 'debug' => true, 'cache' => false)); $template = $twig->loadTemplate('index'); @@ -47,7 +47,7 @@ class Twig_Tests_ErrorTest extends PHPUnit_Framework_TestCase public function testRenderWrapsExceptions() { - $loader = new Twig_Loader_Array(array('index' => "\n\n\n{{ foo.bar }}")); + $loader = new Twig_Loader_Array(array('index' => "\n\n\n{{ foo.bar }}\n\n\n\n{{ 'foo' }}")); $twig = new Twig_Environment($loader, array('strict_variables' => true, 'debug' => true, 'cache' => false)); $template = $twig->loadTemplate('index'); @@ -69,6 +69,9 @@ class Twig_Tests_ErrorTest extends PHPUnit_Framework_TestCase 'index' => "{% extends 'base' %} {% block content %} {{ foo.bar }} + {% endblock %} + {% block foo %} + {{ foo.bar }} {% endblock %}", 'base' => '{% block content %}{% endblock %}' )); -- 1.7.2.5