2020-06-13 12:19:24 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Tests\Traits;
|
|
|
|
|
|
|
|
use Illuminate\Support\Facades\File;
|
|
|
|
|
|
|
|
trait SandboxesTests
|
|
|
|
{
|
|
|
|
private static function createSandbox(): void
|
|
|
|
{
|
2020-09-12 15:01:48 +00:00
|
|
|
config(['koel.album_cover_dir' => 'sandbox/img/covers/']);
|
|
|
|
config(['koel.artist_image_dir' => 'sandbox/img/artists/']);
|
2020-06-13 12:19:24 +00:00
|
|
|
|
2024-01-04 21:51:32 +00:00
|
|
|
File::ensureDirectoryExists(public_path(config('koel.album_cover_dir')));
|
|
|
|
File::ensureDirectoryExists(public_path(config('koel.artist_image_dir')));
|
|
|
|
File::ensureDirectoryExists(public_path('sandbox/media/'));
|
2020-06-13 12:19:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private static function destroySandbox(): void
|
|
|
|
{
|
2020-09-12 15:01:48 +00:00
|
|
|
File::deleteDirectory(public_path('sandbox'));
|
2020-06-13 12:19:24 +00:00
|
|
|
}
|
|
|
|
}
|