Skip to content

Commit e349f18

Browse files
committed
Fixes #70, #69
1 parent afc2328 commit e349f18

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/Unit/CachedBuilderTest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -773,4 +773,24 @@ public function testWhereBetweenDatesResults()
773773
$this->assertTrue($cachedResults->diffKeys($books)->isEmpty());
774774
$this->assertTrue($liveResults->diffKeys($books)->isEmpty());
775775
}
776+
777+
public function testWhereDatesResults()
778+
{
779+
$books = (new Book)
780+
->whereDate('created_at', '>=', '2018-01-01')
781+
->get();
782+
$key = sha1('genealabslaravelmodelcachingtestsfixturesbook-created_at_>=_2018-01-01');
783+
$tags = [
784+
'genealabslaravelmodelcachingtestsfixturesbook',
785+
];
786+
787+
$cachedResults = cache()->tags($tags)
788+
->get($key);
789+
$liveResults = (new UncachedAuthor)
790+
->whereBetween('price', [5, 10])
791+
->get();
792+
793+
$this->assertTrue($cachedResults->diffKeys($books)->isEmpty());
794+
$this->assertTrue($liveResults->diffKeys($books)->isEmpty());
795+
}
776796
}

0 commit comments

Comments
 (0)