/
evo
/
docviz
Обзор
Документация
Войти
/
evo
/
docviz
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
main
tests/Feature/SettingsTest.php
57 строк
2 KB
evo
UI updates, deployment prep, and code highlighting fix
08 фев 2026, 12:17
Верифицирован
08 фев 2026, 12:17
2c0897e
Код
Авторство
О чём код?
<?php namespace Tests\Feature; use App\Models\User; use Illuminate\Foundation\Testing\RefreshDatabase; use Tests\TestCase; class SettingsTest extends TestCase { use RefreshDatabase; public function test_settings_index_requires_owner_role(): void { $user = User::factory()->admin()->create(); $response = $this->actingAs($user)->get(route('dashboard.settings.index')); $response->assertStatus(403); } public function test_owner_can_access_settings(): void { $user = User::factory()->owner()->create(); $response = $this->actingAs($user)->get(route('dashboard.settings.index')); $response->assertStatus(200); } public function test_owner_can_update_settings(): void { $user = User::factory()->owner()->create(); $response = $this->actingAs($user)->put(route('dashboard.settings.update'), [ 'filesystem_disk' => 'local', 'db_connection' => 'sqlite', 'db_host' => 'localhost', 'db_port' => '3306', 'db_database' => 'test', 'db_username' => 'root', 'mail_mailer' => 'array', 'mail_from_address' => 'test@example.com', 'mail_from_name' => 'Test', ]); $response->assertRedirect(); } public function test_owner_can_run_test_database(): void { $user = User::factory()->owner()->create(); $response = $this->actingAs($user)->post(route('dashboard.settings.test-database')); $response->assertRedirect(); } public function test_owner_can_run_test_storage(): void { $user = User::factory()->owner()->create(); $response = $this->actingAs($user)->post(route('dashboard.settings.test-storage')); $response->assertRedirect(); } }