Files
vuefilemanager/tests/Feature/Setup/SetupServiceTest.php
2021-03-27 18:53:41 +01:00

65 lines
1.4 KiB
PHP

<?php
namespace Tests\Feature\Setup;
use App\Models\Language;
use App\Models\LanguageString;
use App\Models\Setting;
use App\Services\SetupService;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Storage;
use Tests\TestCase;
class SetupServiceTest extends TestCase
{
use DatabaseMigrations;
public function __construct()
{
parent::__construct();
$this->setup = app()->make(SetupService::class);
}
/**
* @test
*/
public function it_create_system_folders()
{
Storage::fake('local');
$this->setup->create_directories();
collect(['avatars', 'chunks', 'system', 'files', 'temp', 'zip'])
->each(function ($directory) {
Storage::disk('local')->assertExists($directory);
});
}
/**
* @test
*/
public function it_seed_default_language()
{
Setting::create([
'name' => 'license',
'value' => 'Extended',
]);
Language::create([
'name' => 'English',
'locale' => 'en'
]);
$this->assertDatabaseHas('languages', [
'name' => 'English',
'locale' => 'en',
]);
$this->assertDatabaseHas('language_strings', [
'key' => 'actions.close',
'value' => 'Close',
'lang' => 'en',
]);
}
}