mirror of
https://github.com/koel/koel
synced 2024-12-01 08:19:18 +00:00
28 lines
674 B
PHP
28 lines
674 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 = static::mockIocDependency(MediaSyncService::class);
|
|
}
|
|
|
|
public function testSaveSettings(): void
|
|
{
|
|
$this->mediaSyncService->shouldReceive('sync')->once();
|
|
|
|
$user = factory(User::class)->states('admin')->create();
|
|
$this->postAsUser('/api/settings', ['media_path' => __DIR__], $user);
|
|
|
|
self::assertEquals(__DIR__, Setting::get('media_path'));
|
|
}
|
|
}
|