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