Skip to content

Commit a243aa3

Browse files
committed
Remove property passthru
1 parent 5bf3685 commit a243aa3

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

src/Query/Model/Builder.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Closure;
66
use DateTime;
7+
use Exception;
78
use LdapRecord\Models\Attributes\Guid;
89
use LdapRecord\Models\Collection;
910
use LdapRecord\Models\Model;
@@ -109,15 +110,6 @@ public function __call(string $method, array $parameters): mixed
109110
return $this;
110111
}
111112

112-
/**
113-
* Dynamically access properties on the underlying query builder.
114-
*/
115-
public function __get(string $name): mixed
116-
{
117-
// TODO: Fix all property passthru.
118-
return $this->query->{$name};
119-
}
120-
121113
/**
122114
* Force a clone of the underlying query builder when cloning.
123115
*/

tests/Unit/Models/ActiveDirectory/UserTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,15 +142,15 @@ public function test_reject_computer_object_class_is_a_default_scope()
142142

143143
public function test_scope_where_has_mailbox_is_applied()
144144
{
145-
$filters = User::whereHasMailbox()->filters;
145+
$filters = User::whereHasMailbox()->getQuery()->filters;
146146

147147
$this->assertEquals('msExchMailboxGuid', $filters['and'][4]['attribute']);
148148
$this->assertEquals('*', $filters['and'][4]['operator']);
149149
}
150150

151151
public function test_scope_where_has_lockout_is_applied()
152152
{
153-
$filters = User::whereHasLockout()->filters;
153+
$filters = User::whereHasLockout()->getQuery()->filters;
154154

155155
$this->assertEquals('lockoutTime', $filters['and'][4]['attribute']);
156156
$this->assertEquals('>=', $filters['and'][4]['operator']);

tests/Unit/Query/Model/ActiveDirectoryBuilderTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function test_where_member_of_substitutes_base_dn()
4242
$b = $this->newBuilder();
4343
$b->setBaseDn('dc=org,dc=acme');
4444
$b->whereMemberOf('cn=Accounting,{base}');
45-
$where = $b->filters['and'][0];
45+
$where = $b->getQuery()->filters['and'][0];
4646
$this->assertEquals('memberof', $where['attribute']);
4747
$this->assertEquals('=', $where['operator']);
4848
$this->assertEquals(
@@ -74,7 +74,7 @@ public function test_where_member_of_nested_substitutes_base_dn()
7474
$b = $this->newBuilder();
7575
$b->setBaseDn('dc=org,dc=acme');
7676
$b->whereMemberOf('cn=Accounting,{base}', nested: true);
77-
$where = $b->filters['and'][0];
77+
$where = $b->getQuery()->filters['and'][0];
7878
$this->assertEquals('memberof:1.2.840.113556.1.4.1941:', $where['attribute']);
7979
$this->assertEquals('=', $where['operator']);
8080
$this->assertEquals(
@@ -111,7 +111,7 @@ public function test_or_where_member_of_substitutes_base_dn()
111111
$b->setBaseDn('dc=org,dc=acme');
112112
$b->orWhereEquals('cn', 'John Doe');
113113
$b->orWhereMemberOf('cn=Accounting,{base}');
114-
$where = $b->filters['or'][1];
114+
$where = $b->getQuery()->filters['or'][1];
115115
$this->assertEquals('memberof', $where['attribute']);
116116
$this->assertEquals('=', $where['operator']);
117117
$this->assertEquals(

0 commit comments

Comments
 (0)