Improve error reporting

This commit is contained in:
Fabien Potencier
2025-02-22 10:22:21 +01:00
parent d13d31bb68
commit d5dc3eee99
2 changed files with 11 additions and 26 deletions
+2 -2
View File
@@ -97,7 +97,7 @@ EOHTML,
$this->fail();
} catch (RuntimeError $e) {
$this->assertEquals('Variable "foo" does not exist.', $e->getMessage());
$this->assertEquals('Variable "foo" does not exist in "index.html" at line 3.', $e->getMessage());
$this->assertEquals(3, $e->getTemplateLine());
$this->assertEquals('index.html', $e->getSourceContext()->getName());
$this->assertEquals(3, $e->getLine());
@@ -116,7 +116,7 @@ EOHTML,
$this->fail();
} catch (RuntimeError $e) {
$this->assertEquals('An exception has been thrown during the rendering of a template ("Runtime error...").', $e->getMessage());
$this->assertEquals('An exception has been thrown during the rendering of a template ("Runtime error...") in "index.html" at line 3.', $e->getMessage());
$this->assertEquals(3, $e->getTemplateLine());
$this->assertEquals('index.html', $e->getSourceContext()->getName());
$this->assertEquals(3, $e->getLine());