8000 [TwigBundle] fix test case · symfony/symfony@4ca6eea · GitHub
[go: up one dir, main page]

Skip to content

Commit 4ca6eea

Browse files
[TwigBundle] fix test case
1 parent 8eaa5a8 commit 4ca6eea

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/Symfony/Bundle/TwigBundle/Tests/Functional/EmptyAppTest.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Symfony\Component\Config\Loader\LoaderInterface;
1717
use Symfony\Component\DependencyInjection\ContainerBuilder;
1818
use Symfony\Component\ErrorRenderer\ErrorRenderer;
19+
use Symfony\Component\Filesystem\Filesystem;
1920
use Symfony\Component\HttpKernel\Kernel;
2021

2122
class EmptyAppTest extends TestCase
@@ -28,6 +29,26 @@ public function testBootEmptyApp()
2829
$this->assertTrue($kernel->getContainer()->hasParameter('twig.default_path'));
2930
$this->assertNotEmpty($kernel->getContainer()->getParameter('twig.default_path'));
3031
}
32+
33+
protected function setUp()
34+
{
35+
$this->deleteTempDir();
36+
}
37+
38+
protected function tearDown()
39+
{
40+
$this->deleteTempDir();
41+
}
42+
43+
private function deleteTempDir()
44+
{
45+
if (!file_exists($dir = sys_get_temp_dir().'/'.Kernel::VERSION.'/EmptyAppKernel')) {
46+
return;
47+
}
48+
49+
$fs = new Filesystem();
50+
$fs->remove($dir);
51+
}
3152
}
3253

3354
class EmptyAppKernel extends Kernel

0 commit comments

Comments
 (0)
0