From 21e5397f3b3f52c9458f44983ed5678ed233b131 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 1 Jun 2010 13:22:58 +0200 Subject: [PATCH] made error messages in tests more explicit about where the error occurred --- test/Twig/Tests/integrationTest.php | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/test/Twig/Tests/integrationTest.php b/test/Twig/Tests/integrationTest.php index 8adbac7..3c7d854 100644 --- a/test/Twig/Tests/integrationTest.php +++ b/test/Twig/Tests/integrationTest.php @@ -43,7 +43,13 @@ class Twig_Tests_IntegrationTest extends PHPUnit_Framework_TestCase $twig->addExtension(new Twig_Extension_Escaper()); $twig->addExtension(new TestExtension()); - $template = $twig->loadTemplate('index.twig'); + try { + $template = $twig->loadTemplate('index.twig'); + } catch (Twig_SyntaxError $e) { + $e->setFilename(str_replace(self::$fixturesDir.'/', '', $file)); + + throw $e; + } preg_match_all('/--DATA--(.*?)--EXPECT--(.*?)(?=\-\-DATA\-\-|$)/s', $test, $matches, PREG_SET_ORDER); foreach ($matches as $match) { -- 1.7.2.5