Skip to content

Commit cc19412

Browse files
committed
[12.x] MemoizedStoreTest with empty prefix
1 parent 4e40cfd commit cc19412

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/Integration/Cache/MemoizedStoreTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,21 @@ public function test_it_uses_correct_keys_for_getMultiple()
121121
$this->assertSame($cacheValue, $memoValue);
122122
}
123123

124+
public function test_it_uses_correct_keys_for_getMultiple_with_empty_prefix()
125+
{
126+
Cache::setPrefix(null);
127+
128+
$data = [
129+
'1' => 'one',
130+
0 => 'zero',
131+
];
132+
Cache::putMany($data);
133+
134+
$this->assertSame($data, Cache::memo()->many(array_keys($data)));
135+
// ensure correct on the second memoized retrieval
136+
$this->assertSame($data, Cache::memo()->many(array_keys($data)));
137+
}
138+
124139
public function test_null_values_are_memoized_when_retrieving_multiple_values()
125140
{
126141
$live = Cache::getMultiple(['name.0', 'name.1']);

0 commit comments

Comments
 (0)