File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
src/Symfony/Bundle/TwigBundle/Tests/Loader Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -98,4 +98,21 @@ public function testTwigErrorIfLocatorReturnsFalse()
98
98
$ loader = new FilesystemLoader ($ locator , $ parser );
99
99
$ loader ->getCacheKey ('name.format.engine ' );
100
100
}
101
+
102
+ /**
103
+ * @expectedException \Twig_Error_Loader
104
+ * @expectedExceptionMessageRegExp /Unable to find template "name\.format\.engine" \(looked into: .*\/Tests\/Loader\/\.\.\/DependencyInjection\/Fixtures\/Resources\/views\)/
105
+ */
106
+ public function testTwigErrorIfTemplateDoesNotExist ()
107
+ {
108
+ $ parser = $ this ->getMock ('Symfony\Component\Templating\TemplateNameParserInterface ' );
109
+ $ locator = $ this ->getMock ('Symfony\Component\Config\FileLocatorInterface ' );
110
+
111
+ $ loader = new FilesystemLoader ($ locator , $ parser );
112
+ $ loader ->addPath (__DIR__ .'/../DependencyInjection/Fixtures/Resources/views ' );
113
+
114
+ $ method = new \ReflectionMethod ('Symfony\Bundle\TwigBundle\Loader\FilesystemLoader ' , 'findTemplate ' );
115
+ $ method ->setAccessible (true );
116
+ $ method ->invoke ($ loader , 'name.format.engine ' );
117
+ }
101
118
}
You can’t perform that action at this time.
0 commit comments