Skip to content

Commit 207734b

Browse files
committed
Add another test
1 parent afb389c commit 207734b

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

phpunit.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
printerClass="Codedungeon\PHPUnitPrettyResultPrinter\Printer"
1111
processIsolation="false"
1212
stopOnFailure="false"
13-
syntaxCheck="false"
1413
>
1514
<testsuites>
1615
<testsuite name="Feature">

tests/Integration/CachedBuilder/WhereTest.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)