Files
ppeasy_vg12/tests/Feature/Web/Settings/ApprovalSettingsTest.php
T
2026-10-09 08:21:06 +02:00

36 lines
873 B
PHP

<?php
use Illuminate\Foundation\Testing\RefreshDatabase;
uses(RefreshDatabase::class);
beforeEach(function () {
$this->artisan('db:seed');
});
test('enable two factor', function () {
Setting::set('approval.enabled', false);
$this->assertFalse(Setting::get('approval.enabled'));
$this->actingAsAdmin()
->from('/settings/auth')
->post('/settings/auth/approval/enable')
->assertRedirect('/settings/auth');
$this->assertTrue(Setting::get('approval.enabled'));
});
test('disable two factor', function () {
Setting::set('approval.enabled', true);
$this->assertTrue(Setting::get('approval.enabled'));
$this->actingAsAdmin()
->from('/settings/auth')
->post('/settings/auth/approval/disable')
->assertRedirect('/settings/auth');
$this->assertFalse(Setting::get('approval.enabled'));
});