From: Fabien Potencier Date: Tue, 1 Jun 2010 11:22:58 +0000 (+0200) Subject: made error messages in tests more explicit about where the error occurred X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=21e5397f3b3f52c9458f44983ed5678ed233b131;p=web%2Fkonrad%2Ftwig.git made error messages in tests more explicit about where the error occurred --- 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) {