Skip to content

Commit 6fee1c4

Browse files
committed
fixed test
1 parent d5ede8e commit 6fee1c4

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/Traits/QueryCacheModule.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,11 +318,12 @@ public function cacheBaseTags(array $tags = [])
318318
/**
319319
* Use a plain key instead of a hashed one in the cache driver.
320320
*
321+
* @param bool $usePlainKey
321322
* @return \Rennokki\QueryCache\Traits\QueryCacheModule
322323
*/
323-
public function withPlainKey()
324+
public function withPlainKey(bool $usePlainKey = true)
324325
{
325-
$this->cacheUsePlainKey = true;
326+
$this->cacheUsePlainKey = $usePlainKey;
326327

327328
return $this;
328329
}

tests/MethodsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public function test_cache_flush_with_default_tags_attached()
119119
public function test_hashed_key()
120120
{
121121
$kid = factory(Kid::class)->create();
122-
$storedKid = Kid::cacheFor(now()->addHours(1))->first();
122+
$storedKid = Kid::cacheFor(now()->addHours(1))->withPlainKey(false)->first();
123123
$cache = Cache::get('leqc:156667fa9bcb7fb8abb01018568648406f251ef65736e89e6fd27d08bc48b5bb');
124124

125125
$this->assertNotNull($cache);

0 commit comments

Comments
 (0)