mirror of
https://github.com/twigphp/Twig.git
synced 2026-10-08 04:45:47 +00:00
Fix: A template name cannot be an absolute path
This commit is contained in:
committed by
Fabien Potencier
parent
9773024395
commit
3a67fc7dc5
@@ -32,11 +32,13 @@ class FilesystemTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
$loader = new FilesystemLoader([__DIR__.'/../Fixtures']);
|
||||
|
||||
$this->expectException(LoaderError::class);
|
||||
try {
|
||||
$loader->getCacheKey($template);
|
||||
$this->fail();
|
||||
} catch (LoaderError $e) {
|
||||
$this->assertStringNotContainsString('Unable to find template', $e->getMessage());
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,6 +64,14 @@ class FilesystemTest extends \PHPUnit\Framework\TestCase
|
||||
['filters\\\\..\\\\..\\\\AutoloaderTest.php'],
|
||||
['filters\\//../\\/\\..\\AutoloaderTest.php'],
|
||||
['/../AutoloaderTest.php'],
|
||||
['/AutoloaderTest.php'],
|
||||
['\\AutoloaderTest.php'],
|
||||
['//AutoloaderTest.php'],
|
||||
['\\\\AutoloaderTest.php'],
|
||||
['/./AutoloaderTest.php'],
|
||||
['\\.\\AutoloaderTest.php'],
|
||||
['C:/AutoloaderTest.php'],
|
||||
['C:\\AutoloaderTest.php'],
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user