44
55use LdapRecord \Connection ;
66use LdapRecord \Models \ActiveDirectory \Entry ;
7+ use LdapRecord \Query \Builder ;
78use LdapRecord \Query \Model \ActiveDirectoryBuilder ;
89use LdapRecord \Testing \LdapFake ;
910use LdapRecord \Tests \TestCase ;
@@ -12,7 +13,9 @@ class ActiveDirectoryTest extends TestCase
1213{
1314 protected function newBuilder (): ActiveDirectoryBuilder
1415 {
15- return (new ActiveDirectoryBuilder (new Connection ([], new LdapFake )))->setModel (new Entry );
16+ return new ActiveDirectoryBuilder (
17+ new Entry , new Builder (new Connection ([], new LdapFake ))
18+ );
1619 }
1720
1821 public function test_where_member_of ()
@@ -21,7 +24,7 @@ public function test_where_member_of()
2124
2225 $ b ->whereMemberOf ('cn=Accounting,dc=org,dc=acme ' , $ nested = false );
2326
24- $ where = $ b ->filters ['and ' ][0 ];
27+ $ where = $ b ->getQuery ()-> filters ['and ' ][0 ];
2528
2629 $ this ->assertEquals ('memberof ' , $ where ['field ' ]);
2730 $ this ->assertEquals ('= ' , $ where ['operator ' ]);
@@ -35,7 +38,7 @@ public function test_where_member_of_nested()
3538
3639 $ b ->whereMemberOf ('cn=Accounting,dc=org,dc=acme ' , $ nested = true );
3740
38- $ where = $ b ->filters ['and ' ][0 ];
41+ $ where = $ b ->getQuery ()-> filters ['and ' ][0 ];
3942
4043 $ this ->assertEquals ('memberof:1.2.840.113556.1.4.1941: ' , $ where ['field ' ]);
4144 $ this ->assertEquals ('= ' , $ where ['operator ' ]);
@@ -50,7 +53,7 @@ public function test_or_where_member_of()
5053 $ b ->orWhereEquals ('cn ' , 'John Doe ' );
5154 $ b ->orWhereMemberOf ('cn=Accounting,dc=org,dc=acme ' , $ nested = false );
5255
53- $ where = $ b ->filters ['or ' ][1 ];
56+ $ where = $ b ->getQuery ()-> filters ['or ' ][1 ];
5457
5558 $ this ->assertEquals ('memberof ' , $ where ['field ' ]);
5659 $ this ->assertEquals ('= ' , $ where ['operator ' ]);
@@ -68,7 +71,7 @@ public function test_or_where_member_of_nested()
6871 $ b ->orWhereEquals ('cn ' , 'John Doe ' );
6972 $ b ->orWhereMemberOf ('cn=Accounting,dc=org,dc=acme ' , $ nested = true );
7073
71- $ where = $ b ->filters ['or ' ][1 ];
74+ $ where = $ b ->getQuery ()-> filters ['or ' ][1 ];
7275
7376 $ this ->assertEquals ('memberof:1.2.840.113556.1.4.1941: ' , $ where ['field ' ]);
7477 $ this ->assertEquals ('= ' , $ where ['operator ' ]);
0 commit comments