From 62ac91f3ff34f412175fd9cbb586148174b98729 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Wed, 23 Oct 2024 10:45:17 +0200 Subject: [PATCH] add tests covering getMultiple() with a wrapped tag aware adapter --- .../Component/Cache/Tests/Psr16CacheTest.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/Symfony/Component/Cache/Tests/Psr16CacheTest.php b/src/Symfony/Component/Cache/Tests/Psr16CacheTest.php index cd4375c441fc0..5c11b1f4c5445 100644 --- a/src/Symfony/Component/Cache/Tests/Psr16CacheTest.php +++ b/src/Symfony/Component/Cache/Tests/Psr16CacheTest.php @@ -14,6 +14,7 @@ use Cache\IntegrationTests\SimpleCacheTest; use Psr\SimpleCache\CacheInterface; use Symfony\Component\Cache\Adapter\FilesystemAdapter; +use Symfony\Component\Cache\Adapter\TagAwareAdapter; use Symfony\Component\Cache\PruneableInterface; use Symfony\Component\Cache\Psr16Cache; @@ -173,6 +174,22 @@ protected function isPruned(CacheInterface $cache, string $name): bool return !file_exists($getFileMethod->invoke($pool, $name)); } + + public function testGetMultipleWithTagAwareAdapter() + { + if (isset($this->skippedTests[__FUNCTION__])) { + $this->markTestSkipped($this->skippedTests[__FUNCTION__]); + } + + $cache = new Psr16Cache(new TagAwareAdapter(new FilesystemAdapter())); + + $cache->set('foo', 'foo-val'); + $cache->set('bar', 'bar-val'); + $cache->set('baz', 'baz-val'); + $cache->set('qux', 'qux-val'); + + $this->assertEquals(['foo' => 'foo-val', 'bar' => 'bar-val', 'baz' => 'baz-val', 'qux' => 'qux-val'], $cache->getMultiple(['foo', 'bar', 'baz', 'qux'])); + } } class NotUnserializable