@@ -24,17 +24,17 @@ final class OAuthAuthenticationTest extends TestCase
2424
2525 public function test_redirects_to_oauth_provider (): void
2626 {
27- $ this ->app ['router ' ]->get (__METHOD__ , function (Request $ request ) {
27+ $ this ->app ['router ' ]->get (__FUNCTION__ , function (Request $ request ) {
2828 return $ this ->mock_controller ()->oauthRedirect ($ request );
2929 });
3030
31- $ response = $ this ->get (__METHOD__ );
31+ $ response = $ this ->get (__FUNCTION__ );
3232 $ response ->assertRedirect (self ::OAUTH_DUMMY_PROVIDER_URL );
3333 }
3434
3535 public function test_callback_success (): void
3636 {
37- $ this ->app ['router ' ]->get (__METHOD__ , function (Request $ request ) {
37+ $ this ->app ['router ' ]->get (__FUNCTION__ , function (Request $ request ) {
3838 $ oauthUser = $ this ->createStub (User::class);
3939 $ oauthUser ->token = 'a ' ;
4040 $ oauthUser ->method ('getRaw ' )->willReturn ([
@@ -47,7 +47,7 @@ public function test_callback_success(): void
4747 return $ this ->mock_controller ($ driver )->oauthCallback ($ request );
4848 });
4949
50- $ response = $ this ->get (__METHOD__ );
50+ $ response = $ this ->get (__FUNCTION__ );
5151 $ response ->assertRedirect ('/logged-in ' );
5252 $ this ->assertAuthenticated ();
5353 }
@@ -59,14 +59,14 @@ public function test_exceptions_restart_flow_for_invalid_state(): void
5959 //
6060 })->name ('login-oauth-redirect ' );
6161
62- $ this ->app ['router ' ]->get (__METHOD__ , function (Request $ request ) use ($ exception ) {
62+ $ this ->app ['router ' ]->get (__FUNCTION__ , function (Request $ request ) use ($ exception ) {
6363 $ driver = $ this ->createStub (AzureDriver::class);
6464 $ driver ->method ('user ' )->willThrowException ($ exception );
6565
6666 return $ this ->mock_controller ($ driver )->oauthCallback ($ request );
6767 });
6868
69- $ response = $ this ->get (__METHOD__ );
69+ $ response = $ this ->get (__FUNCTION__ );
7070 $ response ->assertRedirect ('/login-oauth-redirect ' );
7171 }
7272
@@ -85,56 +85,56 @@ public function test_exceptions_restart_flow_for_guzzle_400_code(): void
8585 //
8686 })->name ('login-oauth-redirect ' );
8787
88- $ this ->app ['router ' ]->get (__METHOD__ , function (Request $ request ) use ($ exception ) {
88+ $ this ->app ['router ' ]->get (__FUNCTION__ , function (Request $ request ) use ($ exception ) {
8989 $ driver = $ this ->createStub (AzureDriver::class);
9090 $ driver ->method ('user ' )->willThrowException ($ exception );
9191
9292 return $ this ->mock_controller ($ driver )->oauthCallback ($ request );
9393 });
9494
95- $ response = $ this ->get (__METHOD__ );
95+ $ response = $ this ->get (__FUNCTION__ );
9696 $ response ->assertRedirect ('/login-oauth-redirect ' );
9797 }
9898
9999 public function test_unhandled_exceptions_are_rethrown (): void
100100 {
101- $ this ->app ['router ' ]->get (__METHOD__ , function (Request $ request ) {
101+ $ this ->app ['router ' ]->get (__FUNCTION__ , function (Request $ request ) {
102102 $ driver = $ this ->createStub (AzureDriver::class);
103103 $ driver ->method ('user ' )->willThrowException (new \Exception ('Unhandled, yay! ' ));
104104
105105 return $ this ->mock_controller ($ driver )->oauthCallback ($ request );
106106 });
107107
108- $ response = $ this ->get (__METHOD__ );
108+ $ response = $ this ->get (__FUNCTION__ );
109109 $ this ->assertEquals ('Unhandled, yay! ' , $ response ->exception ->getMessage ());
110110 }
111111
112112 public function test_logout (): void
113113 {
114- $ this ->app ['router ' ]->post (__METHOD__ , function (Request $ request ) {
114+ $ this ->app ['router ' ]->post (__FUNCTION__ , function (Request $ request ) {
115115 $ driver = $ this ->createStub (AzureDriver::class);
116116 $ driver ->method ('getLogoutUrl ' )->willReturn ('/oauth2/v2.0/logout ' );
117117
118118 return $ this ->mock_controller ($ driver )->oauthLogout ();
119119 });
120120
121121 Auth::shouldReceive ('logout ' )->once ();
122- $ response = $ this ->post (__METHOD__ );
122+ $ response = $ this ->post (__FUNCTION__ );
123123 $ response ->assertRedirect ();
124124 $ this ->assertStringContainsString ('/oauth2/v2.0/logout ' , $ response ->headers ->get ('Location ' ));
125125 }
126126
127127 public function test_logout_with_redirect (): void
128128 {
129- $ this ->app ['router ' ]->post (__METHOD__ , function (Request $ request ) {
129+ $ this ->app ['router ' ]->post (__FUNCTION__ , function (Request $ request ) {
130130 $ driver = $ this ->createStub (AzureDriver::class);
131131 $ driver ->method ('getLogoutUrl ' )->willReturn ('/oauth2/v2.0/logout ' );
132132
133133 return $ this ->mock_controller ($ driver )->oauthLogout ('https://google.com?foo=1&bar=2 ' );
134134 });
135135
136136 Auth::shouldReceive ('logout ' )->once ();
137- $ response = $ this ->post (__METHOD__ );
137+ $ response = $ this ->post (__FUNCTION__ );
138138 $ response ->assertRedirect ();
139139 $ this ->assertStringContainsString ('/oauth2/v2.0/logout ' , $ response ->headers ->get ('Location ' ));
140140 $ this ->assertStringContainsString ('?post_logout_redirect_uri=https%3A%2F%2Fgoogle.com%3Ffoo%3D1%26bar%3D2 ' , $ response ->headers ->get ('Location ' ));
0 commit comments