X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/9b271e559fd0ca98319cf5ba0d7c26916511b62a..refs/pull/2902/head:/tests/Auth/MfaConfigurationTest.php diff --git a/tests/Auth/MfaConfigurationTest.php b/tests/Auth/MfaConfigurationTest.php index 63a5fa4dd..eb0e2faf0 100644 --- a/tests/Auth/MfaConfigurationTest.php +++ b/tests/Auth/MfaConfigurationTest.php @@ -10,7 +10,6 @@ use Tests\TestCase; class MfaConfigurationTest extends TestCase { - public function test_totp_setup() { $editor = $this->getEditor(); @@ -54,7 +53,7 @@ class MfaConfigurationTest extends TestCase $this->assertDatabaseHas('mfa_values', [ 'user_id' => $editor->id, - 'method' => 'totp', + 'method' => 'totp', ]); $this->assertFalse(session()->has('mfa-setup-totp-secret')); $value = MfaValue::query()->where('user_id', '=', $editor->id) @@ -79,7 +78,7 @@ class MfaConfigurationTest extends TestCase $codes = decrypt(session()->get('mfa-setup-backup-codes')); // Check code format $this->assertCount(16, $codes); - $this->assertEquals(16*11, strlen(implode('', $codes))); + $this->assertEquals(16 * 11, strlen(implode('', $codes))); // Check download link $resp->assertSee(base64_encode(implode("\n\n", $codes))); @@ -94,7 +93,7 @@ class MfaConfigurationTest extends TestCase $this->assertDatabaseHas('mfa_values', [ 'user_id' => $editor->id, - 'method' => 'backup_codes', + 'method' => 'backup_codes', ]); $this->assertFalse(session()->has('mfa-setup-backup-codes')); $value = MfaValue::query()->where('user_id', '=', $editor->id) @@ -153,15 +152,14 @@ class MfaConfigurationTest extends TestCase MfaValue::upsertWithValue($admin, MfaValue::METHOD_TOTP, 'test'); $this->assertEquals(1, $admin->mfaValues()->count()); $resp = $this->actingAs($admin)->get('/mfa/setup'); - $resp->assertElementExists('form[action$="/mfa/remove/totp"]'); + $resp->assertElementExists('form[action$="/mfa/totp/remove"]'); - $resp = $this->delete("/mfa/remove/totp"); - $resp->assertRedirect("/mfa/setup"); + $resp = $this->delete('/mfa/totp/remove'); + $resp->assertRedirect('/mfa/setup'); $resp = $this->followRedirects($resp); $resp->assertSee('Multi-factor method successfully removed'); $this->assertActivityExists(ActivityType::MFA_REMOVE_METHOD); $this->assertEquals(0, $admin->mfaValues()->count()); } - -} \ No newline at end of file +}