🐛 修复 BUG

This commit is contained in:
Wisp X
2022-03-06 21:32:41 +08:00
parent 4ea2f28fd4
commit cebf64a4bb
2 changed files with 16 additions and 1 deletions
+15
View File
@@ -9,10 +9,25 @@ abstract class TestCase extends BaseTestCase
{
use CreatesApplication;
protected array $links = [];
protected function setUp(): void
{
parent::setUp();
$this->links = \config('filesystems.links');
$this->seed(InstallSeeder::class);
}
protected function tearDown(): void
{
parent::tearDown();
foreach (array_flip($this->links) as $link) {
@unlink($link);
// 因 phpunit 运行时根目录和 env 同级,所以创建的符号链接被放到了根目录
// 清理根目录生成的符号链接
@unlink(str_replace('/public', '', $link));
}
}
}