Definition at line 12 of file FilesystemTest.php.
◆ getArrayInheritanceTests()
Twig_Tests_Loader_FilesystemTest::getArrayInheritanceTests |
( |
| ) |
|
Definition at line 188 of file FilesystemTest.php.
191 'valid array inheritance' => array(
'array_inheritance_valid_parent.html.twig'),
192 'array inheritance with null first template' => array(
'array_inheritance_null_parent.html.twig'),
193 'array inheritance with empty first template' => array(
'array_inheritance_empty_parent.html.twig'),
194 'array inheritance with non-existent first template' => array(
'array_inheritance_nonexistent_parent.html.twig'),
◆ getBasePaths()
Twig_Tests_Loader_FilesystemTest::getBasePaths |
( |
| ) |
|
Definition at line 96 of file FilesystemTest.php.
100 dirname(__FILE__).
'/Fixtures',
101 'test/Twig/Tests/Loader/Fixtures/named_quater/named_absolute.html',
105 dirname(__FILE__).
'/Fixtures/../Fixtures',
106 'test/Twig/Tests/Loader/Fixtures/named_quater/named_absolute.html',
110 'test/Twig/Tests/Loader/Fixtures',
111 'test/Twig/Tests/Loader/Fixtures/named_quater/named_absolute.html',
116 'Fixtures/named_quater/named_absolute.html',
117 getcwd().
'/test/Twig/Tests/Loader',
121 'Fixtures/named_quater/named_absolute.html',
122 getcwd().
'/test/../test/Twig/Tests/Loader',
◆ getSecurityTests()
Twig_Tests_Loader_FilesystemTest::getSecurityTests |
( |
| ) |
|
Definition at line 37 of file FilesystemTest.php.
40 array(
"AutoloaderTest\0.php"),
41 array(
'..\\AutoloaderTest.php'),
42 array(
'..\\\\\\AutoloaderTest.php'),
43 array(
'../AutoloaderTest.php'),
44 array(
'..////AutoloaderTest.php'),
45 array(
'./../AutoloaderTest.php'),
46 array(
'.\\..\\AutoloaderTest.php'),
47 array(
'././././././../AutoloaderTest.php'),
48 array(
'.\\./.\\./.\\./../AutoloaderTest.php'),
49 array(
'foo/../../AutoloaderTest.php'),
50 array(
'foo\\..\\..\\AutoloaderTest.php'),
51 array(
'foo/../bar/../../AutoloaderTest.php'),
52 array(
'foo/bar/../../../AutoloaderTest.php'),
53 array(
'filters/../../AutoloaderTest.php'),
54 array(
'filters//..//..//AutoloaderTest.php'),
55 array(
'filters\\..\\..\\AutoloaderTest.php'),
56 array(
'filters\\\\..\\\\..\\\\AutoloaderTest.php'),
57 array(
'filters\\//../\\/\\..\\AutoloaderTest.php'),
58 array(
'/../AutoloaderTest.php'),
◆ testArrayInheritance()
Twig_Tests_Loader_FilesystemTest::testArrayInheritance |
( |
|
$templateName | ) |
|
getArrayInheritanceTests
- Parameters
-
$templateName | string Template name with array inheritance |
Definition at line 203 of file FilesystemTest.php.
References $template.
206 $loader->addPath(dirname(__FILE__).
'/Fixtures/inheritance');
210 $template = $twig->loadTemplate($templateName);
211 $this->assertSame(
'VALID Child',
$template->renderBlock(
'body', array()));
Loads template from the filesystem.
Stores the Twig configuration.
◆ testEmptyConstructor()
Twig_Tests_Loader_FilesystemTest::testEmptyConstructor |
( |
| ) |
|
Definition at line 127 of file FilesystemTest.php.
130 $this->assertEquals(array(), $loader->getPaths());
Loads template from the filesystem.
◆ testFindTemplateExceptionNamespace()
Twig_Tests_Loader_FilesystemTest::testFindTemplateExceptionNamespace |
( |
| ) |
|
Definition at line 142 of file FilesystemTest.php.
144 $basePath = dirname(__FILE__).
'/Fixtures';
147 $loader->addPath($basePath.
'/named',
'named');
150 $loader->getSourceContext(
'@named/nowhere.html');
152 $this->assertInstanceof(
'Twig_Error_Loader', $e);
153 $this->assertContains(
'Unable to find template "@named/nowhere.html"', $e->getMessage());
Loads template from the filesystem.
◆ testFindTemplateWithCache()
Twig_Tests_Loader_FilesystemTest::testFindTemplateWithCache |
( |
| ) |
|
Definition at line 157 of file FilesystemTest.php.
159 $basePath = dirname(__FILE__).
'/Fixtures';
162 $loader->addPath($basePath.
'/named',
'named');
165 $namedSource = $loader->getSourceContext(
'@named/index.html')->getCode();
166 $this->assertEquals(
"named path\n", $namedSource);
169 $this->assertEquals(
"path\n", $loader->getSourceContext(
'index.html')->getCode());
Loads template from the filesystem.
◆ testGetNamespaces()
Twig_Tests_Loader_FilesystemTest::testGetNamespaces |
( |
| ) |
|
◆ testGetSourceContext()
Twig_Tests_Loader_FilesystemTest::testGetSourceContext |
( |
| ) |
|
Definition at line 14 of file FilesystemTest.php.
References $path.
16 $path = dirname(__FILE__).
'/../Fixtures';
18 $this->assertEquals(
'errors/index.html', $loader->getSourceContext(
'errors/index.html')->getName());
19 $this->assertEquals(realpath(
$path.
'/errors/index.html'), realpath($loader->getSourceContext(
'errors/index.html')->getPath()));
Loads template from the filesystem.
◆ testLoadTemplateAndRenderBlockWithCache()
Twig_Tests_Loader_FilesystemTest::testLoadTemplateAndRenderBlockWithCache |
( |
| ) |
|
Definition at line 172 of file FilesystemTest.php.
References $template.
175 $loader->addPath(dirname(__FILE__).
'/Fixtures/themes/theme2');
176 $loader->addPath(dirname(__FILE__).
'/Fixtures/themes/theme1');
177 $loader->addPath(dirname(__FILE__).
'/Fixtures/themes/theme1',
'default_theme');
181 $template = $twig->loadTemplate(
'blocks.html.twig');
182 $this->assertSame(
'block from theme 1',
$template->renderBlock(
'b1', array()));
184 $template = $twig->loadTemplate(
'blocks.html.twig');
185 $this->assertSame(
'block from theme 2', $template->renderBlock(
'b2', array()));
Loads template from the filesystem.
Stores the Twig configuration.
◆ testLoadTemplateFromPhar()
Twig_Tests_Loader_FilesystemTest::testLoadTemplateFromPhar |
( |
| ) |
|
PHP 5.3
Definition at line 217 of file FilesystemTest.php.
223 $loader->addPath(
'phar://'.dirname(__FILE__).
'/Fixtures/phar/phar-sample.phar');
224 $this->assertSame(
'hello from phar', $loader->getSourceContext(
'hello.twig')->getCode());
Loads template from the filesystem.
◆ testPaths()
Twig_Tests_Loader_FilesystemTest::testPaths |
( |
|
$basePath, |
|
|
|
$cacheKey, |
|
|
|
$rootPath |
|
) |
| |
getBasePaths
Definition at line 65 of file FilesystemTest.php.
68 $loader->setPaths(array($basePath.
'/named', $basePath.
'/named_bis'),
'named');
69 $loader->addPath($basePath.
'/named_ter',
'named');
70 $loader->addPath($basePath.
'/normal_ter');
71 $loader->prependPath($basePath.
'/normal_final');
72 $loader->prependPath($basePath.
'/named/../named_quater',
'named');
73 $loader->prependPath($basePath.
'/named_final',
'named');
75 $this->assertEquals(array(
76 $basePath.
'/normal_final',
78 $basePath.
'/normal_bis',
79 $basePath.
'/normal_ter',
80 ), $loader->getPaths());
81 $this->assertEquals(array(
82 $basePath.
'/named_final',
83 $basePath.
'/named/../named_quater',
85 $basePath.
'/named_bis',
86 $basePath.
'/named_ter',
87 ), $loader->getPaths(
'named'));
90 $this->assertEquals($cacheKey, str_replace(
'\\',
'/', $loader->getCacheKey(
'@named/named_absolute.html')));
91 $this->assertEquals(
"path (final)\n", $loader->getSourceContext(
'index.html')->getCode());
92 $this->assertEquals(
"path (final)\n", $loader->getSourceContext(
'@__main__/index.html')->getCode());
93 $this->assertEquals(
"named path (final)\n", $loader->getSourceContext(
'@named/index.html')->getCode());
Loads template from the filesystem.
◆ testSecurity()
Twig_Tests_Loader_FilesystemTest::testSecurity |
( |
|
$template | ) |
|
getSecurityTests
Definition at line 25 of file FilesystemTest.php.
References $template.
33 $this->assertNotContains(
'Unable to find template', $e->getMessage());
Exception thrown when an error occurs during template loading.
Loads template from the filesystem.
The documentation for this class was generated from the following file: