4
4
5
5
use Illuminate \Contracts \Routing \Registrar ;
6
6
use 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 ;
9
9
use Laravel \Passport \Passport ;
10
10
use Workbench \App \Models \User ;
11
11
@@ -38,7 +38,7 @@ public function testActingAsWhenTheRouteIsProtectedByCheckScopesMiddleware()
38
38
39
39
$ router ->get ('/foo ' , function () {
40
40
return 'bar ' ;
41
- })->middleware (CheckScopes ::class.':admin,footest ' );
41
+ })->middleware (CheckToken ::class.':admin,footest ' );
42
42
43
43
Passport::actingAs (new User (), ['admin ' , 'footest ' ]);
44
44
@@ -49,23 +49,23 @@ public function testActingAsWhenTheRouteIsProtectedByCheckScopesMiddleware()
49
49
50
50
public function testItCanGenerateDefinitionViaStaticMethod ()
51
51
{
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 );
54
54
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 );
57
57
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 );
60
60
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 );
63
63
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 );
66
66
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 );
69
69
}
70
70
71
71
public function testActingAsWhenTheRouteIsProtectedByCheckForAnyScopeMiddleware ()
@@ -77,7 +77,7 @@ public function testActingAsWhenTheRouteIsProtectedByCheckForAnyScopeMiddleware(
77
77
78
78
$ router ->get ('/foo ' , function () {
79
79
return 'bar ' ;
80
- })->middleware (CheckForAnyScope ::class.':admin,footest ' );
80
+ })->middleware (CheckTokenForAnyScope ::class.':admin,footest ' );
81
81
82
82
Passport::actingAs (new User (), ['footest ' ]);
83
83
@@ -92,7 +92,7 @@ public function testActingAsWhenTheRouteIsProtectedByCheckScopesMiddlewareWithIn
92
92
93
93
$ this ->withoutExceptionHandling ();
94
94
95
- Route::middleware (CheckScopes ::class.':foo:bar,baz:qux ' )->get ('/foo ' , function () {
95
+ Route::middleware (CheckToken ::class.':foo:bar,baz:qux ' )->get ('/foo ' , function () {
96
96
return 'bar ' ;
97
97
});
98
98
@@ -109,7 +109,7 @@ public function testActingAsWhenTheRouteIsProtectedByCheckForAnyScopeMiddlewareW
109
109
110
110
$ this ->withoutExceptionHandling ();
111
111
112
- Route::middleware (CheckForAnyScope ::class.':foo:baz,baz:qux ' )->get ('/foo ' , function () {
112
+ Route::middleware (CheckTokenForAnyScope ::class.':foo:baz,baz:qux ' )->get ('/foo ' , function () {
113
113
return 'bar ' ;
114
114
});
115
115
0 commit comments