mediaSyncService = $this->mockIocDependency(MediaSyncService::class); } public function testSaveSettings(): void { $this->mediaSyncService->shouldReceive('sync')->once(); $user = factory(User::class, 'admin')->create(); file_put_contents('log', $this->postAsUser('/api/settings', ['media_path' => __DIR__], $user) ->response->content()); self::assertEquals(__DIR__, Setting::get('media_path')); } }