44
55use Illuminate \Contracts \Routing \Registrar ;
66use Illuminate \Support \Facades \Route ;
7- use Laravel \Passport \Http \Middleware \CheckForAnyScope ;
8- use Laravel \Passport \Http \Middleware \CheckScopes ;
7+ use Laravel \Passport \Http \Middleware \CheckToken ;
8+ use Laravel \Passport \Http \Middleware \CheckTokenForAnyScope ;
99use Laravel \Passport \Passport ;
1010use Workbench \App \Models \User ;
1111
@@ -38,7 +38,7 @@ public function testActingAsWhenTheRouteIsProtectedByCheckScopesMiddleware()
3838
3939 $ router ->get ('/foo ' , function () {
4040 return 'bar ' ;
41- })->middleware (CheckScopes ::class.':admin,footest ' );
41+ })->middleware (CheckToken ::class.':admin,footest ' );
4242
4343 Passport::actingAs (new User (), ['admin ' , 'footest ' ]);
4444
@@ -49,23 +49,23 @@ public function testActingAsWhenTheRouteIsProtectedByCheckScopesMiddleware()
4949
5050 public function testItCanGenerateDefinitionViaStaticMethod ()
5151 {
52- $ signature = (string ) CheckScopes ::using ('admin ' );
53- $ this ->assertSame ('Laravel\Passport\Http\Middleware\CheckScopes :admin ' , $ signature );
52+ $ signature = (string ) CheckToken ::using ('admin ' );
53+ $ this ->assertSame ('Laravel\Passport\Http\Middleware\CheckToken :admin ' , $ signature );
5454
55- $ signature = (string ) CheckScopes ::using ('admin ' , 'footest ' );
56- $ this ->assertSame ('Laravel\Passport\Http\Middleware\CheckScopes :admin,footest ' , $ signature );
55+ $ signature = (string ) CheckToken ::using ('admin ' , 'footest ' );
56+ $ this ->assertSame ('Laravel\Passport\Http\Middleware\CheckToken :admin,footest ' , $ signature );
5757
58- $ signature = (string ) CheckScopes ::using (['admin ' , 'footest ' ]);
59- $ this ->assertSame ('Laravel\Passport\Http\Middleware\CheckScopes :admin,footest ' , $ signature );
58+ $ signature = (string ) CheckToken ::using (['admin ' , 'footest ' ]);
59+ $ this ->assertSame ('Laravel\Passport\Http\Middleware\CheckToken :admin,footest ' , $ signature );
6060
61- $ signature = (string ) CheckForAnyScope ::using ('admin ' );
62- $ this ->assertSame ('Laravel\Passport\Http\Middleware\CheckForAnyScope :admin ' , $ signature );
61+ $ signature = (string ) CheckTokenForAnyScope ::using ('admin ' );
62+ $ this ->assertSame ('Laravel\Passport\Http\Middleware\CheckTokenForAnyScope :admin ' , $ signature );
6363
64- $ signature = (string ) CheckForAnyScope ::using ('admin ' , 'footest ' );
65- $ this ->assertSame ('Laravel\Passport\Http\Middleware\CheckForAnyScope :admin,footest ' , $ signature );
64+ $ signature = (string ) CheckTokenForAnyScope ::using ('admin ' , 'footest ' );
65+ $ this ->assertSame ('Laravel\Passport\Http\Middleware\CheckTokenForAnyScope :admin,footest ' , $ signature );
6666
67- $ signature = (string ) CheckForAnyScope ::using (['admin ' , 'footest ' ]);
68- $ this ->assertSame ('Laravel\Passport\Http\Middleware\CheckForAnyScope :admin,footest ' , $ signature );
67+ $ signature = (string ) CheckTokenForAnyScope ::using (['admin ' , 'footest ' ]);
68+ $ this ->assertSame ('Laravel\Passport\Http\Middleware\CheckTokenForAnyScope :admin,footest ' , $ signature );
6969 }
7070
7171 public function testActingAsWhenTheRouteIsProtectedByCheckForAnyScopeMiddleware ()
@@ -77,7 +77,7 @@ public function testActingAsWhenTheRouteIsProtectedByCheckForAnyScopeMiddleware(
7777
7878 $ router ->get ('/foo ' , function () {
7979 return 'bar ' ;
80- })->middleware (CheckForAnyScope ::class.':admin,footest ' );
80+ })->middleware (CheckTokenForAnyScope ::class.':admin,footest ' );
8181
8282 Passport::actingAs (new User (), ['footest ' ]);
8383
@@ -92,7 +92,7 @@ public function testActingAsWhenTheRouteIsProtectedByCheckScopesMiddlewareWithIn
9292
9393 $ this ->withoutExceptionHandling ();
9494
95- Route::middleware (CheckScopes ::class.':foo:bar,baz:qux ' )->get ('/foo ' , function () {
95+ Route::middleware (CheckToken ::class.':foo:bar,baz:qux ' )->get ('/foo ' , function () {
9696 return 'bar ' ;
9797 });
9898
@@ -109,7 +109,7 @@ public function testActingAsWhenTheRouteIsProtectedByCheckForAnyScopeMiddlewareW
109109
110110 $ this ->withoutExceptionHandling ();
111111
112- Route::middleware (CheckForAnyScope ::class.':foo:baz,baz:qux ' )->get ('/foo ' , function () {
112+ Route::middleware (CheckTokenForAnyScope ::class.':foo:baz,baz:qux ' )->get ('/foo ' , function () {
113113 return 'bar ' ;
114114 });
115115
0 commit comments