]> BookStack Code Mirror - bookstack/blobdiff - tests/Auth/MfaConfigurationTest.php
Fixes for CodeStyle vol.2
[bookstack] / tests / Auth / MfaConfigurationTest.php
index bdf26fb206557dc55c01c5ebcb6299ef74225c76..eb0e2faf0f32d47134bb342928dcbca2a68016b0 100644 (file)
@@ -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)
@@ -155,13 +154,12 @@ class MfaConfigurationTest extends TestCase
         $resp = $this->actingAs($admin)->get('/mfa/setup');
         $resp->assertElementExists('form[action$="/mfa/totp/remove"]');
 
-        $resp = $this->delete("/mfa/totp/remove");
-        $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
+}