File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 22
33namespace LdapRecord \Tests \Unit \Models ;
44
5+ use Closure ;
56use LdapRecord \Connection ;
67use LdapRecord \Container ;
78use LdapRecord \Models \Model ;
@@ -19,14 +20,23 @@ protected function setUp(): void
1920
2021 Container::addConnection (new Connection );
2122
23+ DirectoryFake::setup ();
24+
2225 ModelWithGlobalScopeTestStub::clearBootedModels ();
2326 }
2427
28+ protected function tearDown (): void
29+ {
30+ DirectoryFake::tearDown ();
31+
32+ parent ::tearDown ();
33+ }
34+
2535 public function test_scopes_can_be_added_to_models ()
2636 {
2737 $ model = new ModelWithGlobalScopeTestStub ;
2838
29- $ this ->assertInstanceOf (\ Closure::class, $ model ->getGlobalScopes ()['foo ' ]);
39+ $ this ->assertInstanceOf (Closure::class, $ model ->getGlobalScopes ()['foo ' ]);
3040 $ this ->assertInstanceOf (ScopeTestStub::class, $ model ->getGlobalScopes ()[ScopeTestStub::class]);
3141 }
3242
@@ -56,6 +66,12 @@ public function test_scopes_are_applied_to_query()
5666 public function test_scopes_are_applied_to_pagination_request ()
5767 {
5868 $ query = (new ModelWithGlobalScopeTestStub )->newQuery ();
69+
70+ $ query ->getConnection ()
71+ ->getLdapConnection ()
72+ ->shouldAllowAnyBind ()
73+ ->expect (['search ' => []]);
74+
5975 $ this ->assertEmpty ($ query ->paginate ());
6076
6177 $ this ->assertEquals ([
You can’t perform that action at this time.
0 commit comments