made error messages in tests more explicit about where the error occurred
authorFabien Potencier <fabien.potencier@gmail.com>
Tue, 1 Jun 2010 11:22:58 +0000 (13:22 +0200)
committerFabien Potencier <fabien.potencier@gmail.com>
Tue, 1 Jun 2010 11:22:58 +0000 (13:22 +0200)
test/Twig/Tests/integrationTest.php

index 8adbac7..3c7d854 100644 (file)
@@ -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) {