koel/tests/Traits/SandboxesTests.php

23 lines
560 B
PHP
Raw Normal View History

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
2020-09-12 15:01:48 +00:00
@mkdir(public_path(config('koel.album_cover_dir')), 0755, true);
@mkdir(public_path(config('koel.artist_image_dir')), 0755, true);
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
}
}