]> BookStack Code Mirror - bookstack/blobdiff - tests/Auth/AuthTest.php
fix tests namespace definition
[bookstack] / tests / Auth / AuthTest.php
index 8494697667ab20762bacd65ec663ade5615dd939..0164978d85d7d44ba18c021802d4526ba73bb156 100644 (file)
@@ -2,8 +2,7 @@
 
 namespace Tests\Auth;
 
-use BookStack\Auth\Access\Mfa\MfaSession;
-use BookStack\Entities\Models\Page;
+use BookStack\Access\Mfa\MfaSession;
 use Illuminate\Testing\TestResponse;
 use Tests\TestCase;
 
@@ -45,7 +44,7 @@ class AuthTest extends TestCase
 
     public function test_mfa_session_cleared_on_logout()
     {
-        $user = $this->getEditor();
+        $user = $this->users->editor();
         $mfaSession = $this->app->make(MfaSession::class);
 
         $mfaSession->markVerifiedForUser($user);
@@ -58,8 +57,7 @@ class AuthTest extends TestCase
     public function test_login_redirects_to_initially_requested_url_correctly()
     {
         config()->set('app.url', 'http://localhost');
-        /** @var Page $page */
-        $page = Page::query()->first();
+        $page = $this->entities->page();
 
         $this->get($page->getUrl())->assertRedirect(url('/login'));
         $this->login('[email protected]', 'password')
@@ -96,7 +94,7 @@ class AuthTest extends TestCase
 
     public function test_login_authenticates_nonadmins_on_default_guard_only()
     {
-        $editor = $this->getEditor();
+        $editor = $this->users->editor();
         $editor->password = bcrypt('password');
         $editor->save();
 
@@ -122,7 +120,7 @@ class AuthTest extends TestCase
     public function test_logged_in_user_with_unconfirmed_email_is_logged_out()
     {
         $this->setSettings(['registration-confirmation' => 'true']);
-        $user = $this->getEditor();
+        $user = $this->users->editor();
         $user->email_confirmed = false;
         $user->save();