2018-04-17 02:11:51 +00:00
|
|
|
<?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\Simple;
|
|
|
|
|
|
|
|
use Symfony\Component\Cache\Simple\ApcuCache;
|
|
|
|
|
|
|
|
class ApcuCacheTest extends CacheTestCase
|
|
|
|
{
|
2024-01-12 05:08:24 +00:00
|
|
|
protected $skippedTests = [
|
2018-04-17 02:11:51 +00:00
|
|
|
'testSetTtl' => 'Testing expiration slows down the test suite',
|
|
|
|
'testSetMultipleTtl' => 'Testing expiration slows down the test suite',
|
|
|
|
'testDefaultLifeTime' => 'Testing expiration slows down the test suite',
|
2024-01-12 05:08:24 +00:00
|
|
|
];
|
2018-04-17 02:11:51 +00:00
|
|
|
|
|
|
|
public function createSimpleCache($defaultLifetime = 0)
|
|
|
|
{
|
2024-01-12 05:08:24 +00:00
|
|
|
if (!\function_exists('apcu_fetch') || !filter_var(ini_get('apc.enabled'), \FILTER_VALIDATE_BOOLEAN) || ('cli' === \PHP_SAPI && !filter_var(ini_get('apc.enable_cli'), \FILTER_VALIDATE_BOOLEAN))) {
|
2018-04-17 02:11:51 +00:00
|
|
|
$this->markTestSkipped('APCu extension is required.');
|
|
|
|
}
|
2024-01-12 05:08:24 +00:00
|
|
|
if ('\\' === \DIRECTORY_SEPARATOR) {
|
2018-04-17 02:11:51 +00:00
|
|
|
$this->markTestSkipped('Fails transiently on Windows.');
|
|
|
|
}
|
|
|
|
|
|
|
|
return new ApcuCache(str_replace('\\', '.', __CLASS__), $defaultLifetime);
|
|
|
|
}
|
|
|
|
}
|