File tree Expand file tree Collapse file tree 3 files changed +20
-3
lines changed Expand file tree Collapse file tree 3 files changed +20
-3
lines changed Original file line number Diff line number Diff line change 29
29
"sebastian/phpcpd" : " *" ,
30
30
"symfony/thanks" : " *" ,
31
31
"predis/predis" : " *" ,
32
- "codedungeon/phpunit-result-printer" : " * "
32
+ "codedungeon/phpunit-result-printer" : " ^0.19.10 "
33
33
},
34
34
"autoload" : {
35
35
"psr-4" : {
Original file line number Diff line number Diff line change @@ -173,8 +173,6 @@ protected function getColumnClauses(array $where) : string
173
173
return "" ;
174
174
}
175
175
176
- $ this ->currentBinding ++;
177
-
178
176
return "- {$ where ["boolean " ]}_ {$ where ["first " ]}_ {$ where ["operator " ]}_ {$ where ["second " ]}" ;
179
177
}
180
178
Original file line number Diff line number Diff line change @@ -38,4 +38,23 @@ public function testHasRelationshipResults()
38
38
$ this ->assertNotEmpty ($ booksWithStores );
39
39
$ this ->assertEquals ($ booksWithStores , $ cachedResults );
40
40
}
41
+
42
+ public function testWhereHasRelationship ()
43
+ {
44
+ $ books = (new Book )
45
+ ->with ("stores " )
46
+ ->whereHas ("stores " , function ($ query ) {
47
+ $ query ->whereRaw ('address like ? ' , ['%s% ' ]);
48
+ })
49
+ ->get ();
50
+
51
+ $ uncachedBooks = (new UncachedBook )
52
+ ->with ("stores " )
53
+ ->whereHas ("stores " , function ($ query ) {
54
+ $ query ->whereRaw ('address like ? ' , ['%s% ' ]);
55
+ })
56
+ ->get ();
57
+
58
+ $ this ->assertEquals ($ books ->pluck ("id " ), $ uncachedBooks ->pluck ("id " ));
59
+ }
41
60
}
You can’t perform that action at this time.
0 commit comments