Skip to content

Commit c004548

Browse files
[HttpKernel] fix transient test
1 parent 5f9abf8 commit c004548

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Tests/KernelTest.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
1717
use Symfony\Component\DependencyInjection\ContainerBuilder;
1818
use Symfony\Component\DependencyInjection\ContainerInterface;
19+
use Symfony\Component\Filesystem\Exception\IOException;
1920
use Symfony\Component\Filesystem\Filesystem;
2021
use Symfony\Component\HttpFoundation\Request;
2122
use Symfony\Component\HttpFoundation\Response;
@@ -35,8 +36,10 @@ class KernelTest extends TestCase
3536
{
3637
protected function tearDown(): void
3738
{
38-
$fs = new Filesystem();
39-
$fs->remove(__DIR__.'/Fixtures/var');
39+
try {
40+
(new Filesystem())->remove(__DIR__.'/Fixtures/var');
41+
} catch (IOException $e) {
42+
}
4043
}
4144

4245
public function testConstructor()
@@ -586,7 +589,7 @@ public function testProjectDirExtension()
586589

587590
public function testKernelReset()
588591
{
589-
(new Filesystem())->remove(__DIR__.'/Fixtures/var/cache');
592+
$this->tearDown();
590593

591594
$kernel = new CustomProjectDirKernel();
592595
$kernel->boot();

0 commit comments

Comments
 (0)