]> BookStack Code Mirror - bookstack/blobdiff - tests/DebugViewTest.php
Drawings: Added class to extract drawio data from png files
[bookstack] / tests / DebugViewTest.php
index 3485b4598e77103d97049219fe15de00cd905528..34de6b80297e5f003c06dc276010ec13460650d1 100644 (file)
@@ -2,7 +2,8 @@
 
 namespace Tests;
 
-use BookStack\Auth\Access\SocialAuthService;
+use BookStack\Access\SocialDriverManager;
+use Illuminate\Testing\TestResponse;
 
 class DebugViewTest extends TestCase
 {
@@ -25,8 +26,8 @@ class DebugViewTest extends TestCase
         // BookStack version
         $resp->assertSeeText('BookStack Version: ' . trim(file_get_contents(base_path('version'))));
         // Dynamic help links
-        $resp->assertElementExists('a[href*="q=' . urlencode('BookStack An error occurred during testing') . '"]');
-        $resp->assertElementExists('a[href*="?q=is%3Aissue+' . urlencode('An error occurred during testing') . '"]');
+        $this->withHtml($resp)->assertElementExists('a[href*="q=' . urlencode('BookStack An error occurred during testing') . '"]');
+        $this->withHtml($resp)->assertElementExists('a[href*="?q=is%3Aissue+' . urlencode('An error occurred during testing') . '"]');
     }
 
     public function test_debug_view_only_shows_when_debug_mode_is_enabled()
@@ -42,13 +43,12 @@ class DebugViewTest extends TestCase
         $resp->assertSeeText('An unknown error occurred');
     }
 
-
     protected function getDebugViewForException(\Exception $exception): TestResponse
     {
         // Fake an error via social auth service used on login page
-        $mockService = $this->mock(SocialAuthService::class);
-        $mockService->shouldReceive('getActiveDrivers')->andThrow($exception);
+        $mockService = $this->mock(SocialDriverManager::class);
+        $mockService->shouldReceive('getActive')->andThrow($exception);
+
         return $this->get('/login');
     }
-
-}
\ No newline at end of file
+}