88use Laravel \Passport \Client as ClientModel ;
99use Laravel \Passport \ClientRepository ;
1010use Laravel \Passport \Passport ;
11- use Mockery ;
11+ use Mockery \Adapter \Phpunit \MockeryPHPUnitIntegration ;
12+ use Mockery as m ;
1213use PHPUnit \Framework \TestCase ;
1314
1415class BridgeScopeRepositoryTest extends TestCase
1516{
17+ use MockeryPHPUnitIntegration;
18+
1619 protected function tearDown (): void
1720 {
1821 Passport::$ withInheritedScopes = false ;
@@ -24,9 +27,9 @@ public function test_invalid_scopes_are_removed()
2427 'scope-1 ' => 'description ' ,
2528 ]);
2629
27- $ client = Mockery ::mock (ClientModel::class)->makePartial ();
30+ $ client = m ::mock (ClientModel::class)->makePartial ();
2831
29- $ clients = Mockery ::mock (ClientRepository::class);
32+ $ clients = m ::mock (ClientRepository::class);
3033 $ clients ->shouldReceive ('findActive ' )->withAnyArgs ()->andReturn ($ client );
3134
3235 $ repository = new ScopeRepository ($ clients );
@@ -44,10 +47,10 @@ public function test_invalid_scopes_are_removed_without_a_client_repository()
4447 'scope-1 ' => 'description ' ,
4548 ]);
4649
47- $ clients = Mockery ::mock (ClientRepository::class);
50+ $ clients = m ::mock (ClientRepository::class);
4851 $ clients ->shouldReceive ('findActive ' )
4952 ->with ('id ' )
50- ->andReturn (Mockery ::mock (ClientModel::class)->makePartial ());
53+ ->andReturn (m ::mock (ClientModel::class)->makePartial ());
5154
5255 $ repository = new ScopeRepository ($ clients );
5356
@@ -65,10 +68,10 @@ public function test_clients_do_not_restrict_scopes_by_default()
6568 'scope-2 ' => 'description ' ,
6669 ]);
6770
68- $ client = Mockery ::mock (ClientModel::class)->makePartial ();
71+ $ client = m ::mock (ClientModel::class)->makePartial ();
6972 $ client ->scopes = null ;
7073
71- $ clients = Mockery ::mock (ClientRepository::class);
74+ $ clients = m ::mock (ClientRepository::class);
7275 $ clients ->shouldReceive ('findActive ' )->withAnyArgs ()->andReturn ($ client );
7376
7477 $ repository = new ScopeRepository ($ clients );
@@ -87,10 +90,10 @@ public function test_scopes_disallowed_for_client_are_removed()
8790 'scope-2 ' => 'description ' ,
8891 ]);
8992
90- $ client = Mockery ::mock (ClientModel::class)->makePartial ();
93+ $ client = m ::mock (ClientModel::class)->makePartial ();
9194 $ client ->scopes = ['scope-1 ' ];
9295
93- $ clients = Mockery ::mock (ClientRepository::class);
96+ $ clients = m ::mock (ClientRepository::class);
9497 $ clients ->shouldReceive ('findActive ' )->withAnyArgs ()->andReturn ($ client );
9598
9699 $ repository = new ScopeRepository ($ clients );
@@ -112,10 +115,10 @@ public function test_scopes_disallowed_for_client_are_removed_but_inherited_scop
112115 'scope-2 ' => 'description ' ,
113116 ]);
114117
115- $ client = Mockery ::mock (ClientModel::class)->makePartial ();
118+ $ client = m ::mock (ClientModel::class)->makePartial ();
116119 $ client ->scopes = ['scope-1 ' ];
117120
118- $ clients = Mockery ::mock (ClientRepository::class);
121+ $ clients = m ::mock (ClientRepository::class);
119122 $ clients ->shouldReceive ('findActive ' )->withAnyArgs ()->andReturn ($ client );
120123
121124 $ repository = new ScopeRepository ($ clients );
@@ -133,9 +136,9 @@ public function test_superuser_scope_cant_be_applied_if_wrong_grant()
133136 'scope-1 ' => 'description ' ,
134137 ]);
135138
136- $ client = Mockery ::mock (ClientModel::class)->makePartial ();
139+ $ client = m ::mock (ClientModel::class)->makePartial ();
137140
138- $ clients = Mockery ::mock (ClientRepository::class);
141+ $ clients = m ::mock (ClientRepository::class);
139142 $ clients ->shouldReceive ('findActive ' )->withAnyArgs ()->andReturn ($ client );
140143
141144 $ repository = new ScopeRepository ($ clients );
@@ -153,10 +156,10 @@ public function test_superuser_scope_cant_be_applied_if_wrong_grant_without_a_cl
153156 'scope-1 ' => 'description ' ,
154157 ]);
155158
156- $ clients = Mockery ::mock (ClientRepository::class);
159+ $ clients = m ::mock (ClientRepository::class);
157160 $ clients ->shouldReceive ('findActive ' )
158161 ->with ('id ' )
159- ->andReturn (Mockery ::mock (ClientModel::class)->makePartial ());
162+ ->andReturn (m ::mock (ClientModel::class)->makePartial ());
160163
161164 $ repository = new ScopeRepository ($ clients );
162165
0 commit comments