mirror of
https://github.com/lsky-org/lsky-pro.git
synced 2025-01-07 03:16:46 +08:00
🐛 修复 BUG
This commit is contained in:
parent
4ea2f28fd4
commit
cebf64a4bb
@ -66,7 +66,7 @@ class Strategy extends Model
|
|||||||
$symlink = self::getRootPath($strategy->configs['url']);
|
$symlink = self::getRootPath($strategy->configs['url']);
|
||||||
$target = $strategy->configs['root'] ?: config('filesystems.disks.uploads.root');
|
$target = $strategy->configs['root'] ?: config('filesystems.disks.uploads.root');
|
||||||
if (! is_dir(public_path($symlink))) {
|
if (! is_dir(public_path($symlink))) {
|
||||||
@(new Filesystem())->link($target, $symlink);
|
(new Filesystem())->link($target, $symlink);
|
||||||
}
|
}
|
||||||
// 是否需要移除旧的符号链接
|
// 是否需要移除旧的符号链接
|
||||||
$url = $strategy->getOriginal('configs')['url'] ?? '';
|
$url = $strategy->getOriginal('configs')['url'] ?? '';
|
||||||
|
@ -9,10 +9,25 @@ abstract class TestCase extends BaseTestCase
|
|||||||
{
|
{
|
||||||
use CreatesApplication;
|
use CreatesApplication;
|
||||||
|
|
||||||
|
protected array $links = [];
|
||||||
|
|
||||||
protected function setUp(): void
|
protected function setUp(): void
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
|
$this->links = \config('filesystems.links');
|
||||||
$this->seed(InstallSeeder::class);
|
$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));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user