Skip to content

Commit 9d917c4

Browse files
[AssetMapper] Surround brittle test teardown with try/catch
1 parent 678fede commit 9d917c4

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/Symfony/Component/AssetMapper/Tests/ImportMap/RemotePackageStorageTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Symfony\Component\AssetMapper\ImportMap\ImportMapEntry;
1616
use Symfony\Component\AssetMapper\ImportMap\ImportMapType;
1717
use Symfony\Component\AssetMapper\ImportMap\RemotePackageStorage;
18+
use Symfony\Component\Filesystem\Exception\IOException;
1819
use Symfony\Component\Filesystem\Filesystem;
1920

2021
class RemotePackageStorageTest extends TestCase
@@ -32,7 +33,11 @@ protected function setUp(): void
3233

3334
protected function tearDown(): void
3435
{
35-
$this->filesystem->remove(self::$writableRoot);
36+
try {
37+
$this->filesystem->remove(self::$writableRoot);
38+
} catch (IOException) {
39+
// no-op
40+
}
3641
}
3742

3843
public function testGetStorageDir()

src/Symfony/Component/AssetMapper/Tests/Path/LocalPublicAssetsFilesystemTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use PHPUnit\Framework\TestCase;
1515
use Symfony\Component\AssetMapper\Path\LocalPublicAssetsFilesystem;
16+
use Symfony\Component\Filesystem\Exception\IOException;
1617
use Symfony\Component\Filesystem\Filesystem;
1718

1819
class LocalPublicAssetsFilesystemTest extends TestCase
@@ -30,7 +31,11 @@ protected function setUp(): void
3031

3132
protected function tearDown(): void
3233
{
33-
$this->filesystem->remove(self::$writableRoot);
34+
try {
35+
$this->filesystem->remove(self::$writableRoot);
36+
} catch (IOException) {
37+
// no-op
38+
}
3439
}
3540

3641
public function testWrite()

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy