File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
tests/Integration/CachedBuilder Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 1010 printerClass =" Codedungeon\PHPUnitPrettyResultPrinter\Printer"
1111 processIsolation =" false"
1212 stopOnFailure =" false"
13- syntaxCheck =" false"
1413>
1514<testsuites >
1615 <testsuite name =" Feature" >
Original file line number Diff line number Diff line change @@ -97,4 +97,25 @@ public function testWhereClauseParsingOfOperators()
9797 $ this ->processWhereClauseTestWithOperator ('LIKE ' );
9898 $ this ->processWhereClauseTestWithOperator ('NOT LIKE ' );
9999 }
100+
101+ public function testTwoWhereClausesAfterEachOther ()
102+ {
103+ $ key = sha1 ('genealabs:laravel-model-caching:testing::memory::genealabslaravelmodelcachingtestsfixturesauthor-id_>_-id_<_100 ' );
104+ $ tags = ['genealabs:laravel-model-caching:testing::memory::genealabslaravelmodelcachingtestsfixturesauthor ' ];
105+
106+ $ authors = (new Author )
107+ ->where ("id " , "> " , 0 )
108+ ->where ("id " , "< " , 100 )
109+ ->get ();
110+ $ cachedResults = $ this ->cache ()
111+ ->tags ($ tags )
112+ ->get ($ key )['value ' ];
113+ $ liveResults = (new UncachedAuthor )
114+ ->where ("id " , "> " , 0 )
115+ ->where ("id " , "< " , 100 )
116+ ->get ();
117+
118+ $ this ->assertEmpty ($ authors ->diffKeys ($ cachedResults ));
119+ $ this ->assertEmpty ($ liveResults ->diffKeys ($ cachedResults ));
120+ }
100121}
You can’t perform that action at this time.
0 commit comments