/
githubmirror
/
symfony
Обзор
Документация
Войти
/
githubmirror
/
symfony
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
8.2
src/Symfony/Component/Cache/Tests/Adapter/Psr16AdapterTest.php
44 строки
1 KB
Nicolas Grekas
Merge branch '6.4' into 7.4
23 май 2026, 19:05
23 май 2026, 19:05
f1ff8b4
Код
Авторство
О чём код?
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Cache\Tests\Adapter; use PHPUnit\Framework\Attributes\Group; use Psr\Cache\CacheItemPoolInterface; use Symfony\Component\Cache\Adapter\ArrayAdapter; use Symfony\Component\Cache\Adapter\FilesystemAdapter; use Symfony\Component\Cache\Adapter\Psr16Adapter; use Symfony\Component\Cache\Psr16Cache; #[Group('time-sensitive')] class Psr16AdapterTest extends AdapterTestCase { protected $skippedTests = [ 'testPrune' => 'Psr16adapter just proxies', 'testClearPrefix' => 'SimpleCache cannot clear by prefix', 'testClearPrefixWithUnderscore' => 'SimpleCache cannot clear by prefix', ]; public function createCachePool(int $defaultLifetime = 0): CacheItemPoolInterface { return new Psr16Adapter(new Psr16Cache(new FilesystemAdapter()), '', $defaultLifetime); } public function testValidCacheKeyWithNamespace() { $cache = new Psr16Adapter(new Psr16Cache(new ArrayAdapter()), 'some_namespace', 0); $item = $cache->getItem('my_key'); $item->set('someValue'); $cache->save($item); $this->assertTrue($cache->getItem('my_key')->isHit(), 'Stored item is successfully retrieved.'); } }