X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/d5ce6b680cbf50ddfa5ede2c680f8546498052ac..refs/pull/3598/head:/tests/Auth/OidcTest.php diff --git a/tests/Auth/OidcTest.php b/tests/Auth/OidcTest.php index 34fd70115..aa2c99a36 100644 --- a/tests/Auth/OidcTest.php +++ b/tests/Auth/OidcTest.php @@ -6,9 +6,9 @@ use BookStack\Actions\ActivityType; use BookStack\Auth\User; use GuzzleHttp\Psr7\Request; use GuzzleHttp\Psr7\Response; +use Illuminate\Testing\TestResponse; use Tests\Helpers\OidcJwtHelper; use Tests\TestCase; -use Tests\TestResponse; class OidcTest extends TestCase { @@ -26,7 +26,6 @@ class OidcTest extends TestCase config()->set([ 'auth.method' => 'oidc', - 'auth.auto_redirect' => false, 'auth.defaults.guard' => 'oidc', 'oidc.name' => 'SingleSignOn-Testing', 'oidc.display_name_claims' => ['name'], @@ -53,7 +52,7 @@ class OidcTest extends TestCase { $req = $this->get('/login'); $req->assertSeeText('SingleSignOn-Testing'); - $req->assertElementExists('form[action$="/oidc/login"][method=POST] button'); + $this->withHtml($req)->assertElementExists('form[action$="/oidc/login"][method=POST] button'); } public function test_oidc_routes_are_only_active_if_oidc_enabled() @@ -112,19 +111,6 @@ class OidcTest extends TestCase $this->assertPermissionError($resp); } - public function test_automatic_redirect_on_login() - { - config()->set([ - 'auth.auto_redirect' => true, - 'services.google.client_id' => false, - 'services.github.client_id' => false, - ]); - $req = $this->get('/login'); - $req->assertSeeText('SingleSignOn-Testing'); - $req->assertElementExists('form[action$="/oidc/login"][method=POST] button'); - $req->assertElementExists('div#loginredirect-wrapper'); - } - public function test_login() { $req = $this->post('/oidc/login');