File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 55use Illuminate \Database \Eloquent \Model ;
66use Illuminate \Http \Request ;
77use Illuminate \Pagination \LengthAwarePaginator ;
8+ use Illuminate \Pagination \Paginator ;
89use Illuminate \Support \Collection ;
910use Spatie \QueryBuilder \Exceptions \InvalidAppendQuery ;
1011use Spatie \QueryBuilder \QueryBuilder ;
@@ -159,4 +160,14 @@ protected function assertPaginateAttributeLoaded(LengthAwarePaginator $collectio
159160
160161 $ this ->assertFalse ($ hasModelWithoutAttributeLoaded , "The ` {$ attribute }` attribute was expected but not loaded. " );
161162 }
163+
164+ protected function assertSimplePaginateAttributeLoaded (Paginator $ collection , string $ attribute )
165+ {
166+ $ hasModelWithoutAttributeLoaded = $ collection
167+ ->contains (function (Model $ model ) use ($ attribute ) {
168+ return ! array_key_exists ($ attribute , $ model ->toArray ());
169+ });
170+
171+ $ this ->assertFalse ($ hasModelWithoutAttributeLoaded , "The ` {$ attribute }` attribute was expected but not loaded. " );
172+ }
162173}
You can’t perform that action at this time.
0 commit comments