mirror of
https://github.com/koel/koel
synced 2024-12-21 10:03:10 +00:00
29 lines
647 B
PHP
29 lines
647 B
PHP
<?php
|
|
|
|
namespace Tests\Feature;
|
|
|
|
use App\Models\Setting;
|
|
use App\Models\User;
|
|
use App\Services\MediaSyncService;
|
|
|
|
class SettingTest extends TestCase
|
|
{
|
|
private $mediaSyncService;
|
|
|
|
public function setUp(): void
|
|
{
|
|
parent::setUp();
|
|
|
|
$this->mediaSyncService = self::mock(MediaSyncService::class);
|
|
}
|
|
|
|
public function testSaveSettings(): void
|
|
{
|
|
$this->mediaSyncService->shouldReceive('sync')->once();
|
|
|
|
$user = User::factory()->admin()->create();
|
|
$this->postAsUser('/api/settings', ['media_path' => __DIR__], $user);
|
|
|
|
self::assertEquals(__DIR__, Setting::get('media_path'));
|
|
}
|
|
}
|