]> BookStack Code Mirror - bookstack/blobdiff - tests/Auth/AuthTest.php
Apply fixes from StyleCI
[bookstack] / tests / Auth / AuthTest.php
index f88fc19044286d5c3e4b937745cff0511437ce13..febf583998d460e10440aa0ec36a2852eaa01641 100644 (file)
@@ -1,4 +1,6 @@
-<?php namespace Tests\Auth;
+<?php
+
+namespace Tests\Auth;
 
 use BookStack\Auth\Role;
 use BookStack\Auth\User;
@@ -14,7 +16,6 @@ use Tests\BrowserKitTest;
 
 class AuthTest extends BrowserKitTest
 {
-
     public function test_auth_working()
     {
         $this->visit('/')
@@ -135,10 +136,10 @@ class AuthTest extends BrowserKitTest
 
         // Get confirmation and confirm notification matches
         $emailConfirmation = DB::table('email_confirmations')->where('user_id', '=', $dbUser->id)->first();
-        Notification::assertSentTo($dbUser, ConfirmEmail::class, function($notification, $channels) use ($emailConfirmation) {
+        Notification::assertSentTo($dbUser, ConfirmEmail::class, function ($notification, $channels) use ($emailConfirmation) {
             return $notification->token === $emailConfirmation->token;
         });
-        
+
         // Check confirmation email confirmation activation.
         $this->visit('/register/confirm/' . $emailConfirmation->token)
             ->seePageIs('/')
@@ -278,8 +279,8 @@ class AuthTest extends BrowserKitTest
             ->press('Save')
             ->seePageIs('/settings/users');
 
-            $userPassword = User::find($user->id)->password;
-            $this->assertTrue(Hash::check('newpassword', $userPassword));
+        $userPassword = User::find($user->id)->password;
+        $this->assertTrue(Hash::check('newpassword', $userPassword));
     }
 
     public function test_user_deletion()
@@ -340,7 +341,7 @@ class AuthTest extends BrowserKitTest
             ->see('A password reset link will be sent to [email protected] if that email address is found in the system.');
 
         $this->seeInDatabase('password_resets', [
-            'email' => '[email protected]'
+            'email' => '[email protected]',
         ]);
 
         $user = User::where('email', '=', '[email protected]')->first();
@@ -351,9 +352,9 @@ class AuthTest extends BrowserKitTest
         $this->visit('/password/reset/' . $n->first()->token)
             ->see('Reset Password')
             ->submitForm('Reset Password', [
-                'email' => '[email protected]',
-                'password' => 'randompass',
-                'password_confirmation' => 'randompass'
+                'email'                 => '[email protected]',
+                'password'              => 'randompass',
+                'password_confirmation' => 'randompass',
             ])->seePageIs('/')
             ->see('Your password has been successfully reset');
     }
@@ -367,13 +368,12 @@ class AuthTest extends BrowserKitTest
             ->see('A password reset link will be sent to [email protected] if that email address is found in the system.')
             ->dontSee('We can\'t find a user');
 
-
         $this->visit('/password/reset/arandometokenvalue')
             ->see('Reset Password')
             ->submitForm('Reset Password', [
-                'email' => '[email protected]',
-                'password' => 'randompass',
-                'password_confirmation' => 'randompass'
+                'email'                 => '[email protected]',
+                'password'              => 'randompass',
+                'password_confirmation' => 'randompass',
             ])->followRedirects()
             ->seePageIs('/password/reset/arandometokenvalue')
             ->dontSee('We can\'t find a user')
@@ -443,7 +443,7 @@ class AuthTest extends BrowserKitTest
     }
 
     /**
-     * Perform a login
+     * Perform a login.
      */
     protected function login(string $email, string $password): AuthTest
     {