Skip to content

Commit 7eecef8

Browse files
committed
add simple windows test
1 parent acdccaf commit 7eecef8

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

tests/Cache/FileSystemCacheItemPoolTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,24 @@ public function testDeleteItemsWithIncorrectKeyShouldThrowAnException($char)
200200
$this->pool->deleteItems([$item->getKey()]);
201201
}
202202

203+
public function testSimpleTempdirCacheWriteOnWindows()
204+
{
205+
$pool = new FileSystemCacheItemPool(sys_get_temp_dir() . '/google_cache/');
206+
$cacheKey = sprintf(
207+
'session_cache.%s.%s.%s.%s',
208+
'myawesomeproject',
209+
'myinstance',
210+
'21995090',
211+
'',
212+
);
213+
$cacheItem = $pool->getItem($cacheKey);
214+
$cacheItem->set('foo');
215+
$pool->save($cacheItem);
216+
217+
$retrievedItem = $pool->getItem($cacheKey);
218+
$this->assertEquals('foo', $retrievedItem->get());
219+
}
220+
203221
private function getNewItem(null|string $key = null): TypedItem
204222
{
205223
$item = new TypedItem($key ?? 'NewItem');

0 commit comments

Comments
 (0)