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 2929 "sebastian/phpcpd" : " *" ,
3030 "symfony/thanks" : " *" ,
3131 "predis/predis" : " *" ,
32- "codedungeon/phpunit-result-printer" : " * "
32+ "codedungeon/phpunit-result-printer" : " ^0.19.10 "
3333 },
3434 "autoload" : {
3535 "psr-4" : {
Original file line number Diff line number Diff line change @@ -173,8 +173,6 @@ protected function getColumnClauses(array $where) : string
173173 return "" ;
174174 }
175175
176- $ this ->currentBinding ++;
177-
178176 return "- {$ where ["boolean " ]}_ {$ where ["first " ]}_ {$ where ["operator " ]}_ {$ where ["second " ]}" ;
179177 }
180178
Original file line number Diff line number Diff line change @@ -38,4 +38,23 @@ public function testHasRelationshipResults()
3838 $ this ->assertNotEmpty ($ booksWithStores );
3939 $ this ->assertEquals ($ booksWithStores , $ cachedResults );
4040 }
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+ }
4160}
You can’t perform that action at this time.
0 commit comments