Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@

namespace Symfony\Component\Cache\Tests\Adapter;

use Cache\IntegrationTests\CachePoolTest;
use Psr\Cache\CacheItemInterface;
use Symfony\Component\Cache\Adapter\NullAdapter;
use Symfony\Component\Cache\Adapter\PhpArrayAdapter;

class PhpArrayAdapterTest extends CachePoolTest
class PhpArrayAdapterTest extends AdapterTestCase
{
protected $skippedTests = array(
'testBasicUsage' => 'PhpArrayAdapter is read-only.',
Expand Down Expand Up @@ -45,6 +44,8 @@ class PhpArrayAdapterTest extends CachePoolTest
'testHasItemInvalidKeys' => 'PhpArrayAdapter does not throw exceptions on invalid key.',
'testDeleteItemInvalidKeys' => 'PhpArrayAdapter does not throw exceptions on invalid key.',
'testDeleteItemsInvalidKeys' => 'PhpArrayAdapter does not throw exceptions on invalid key.',

'testDefaultLifeTime' => 'PhpArrayAdapter does not allow configuring a default lifetime.',
);

private static $file;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@

namespace Symfony\Component\Cache\Tests\Adapter;

use Cache\IntegrationTests\CachePoolTest;
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
use Symfony\Component\Cache\Adapter\PhpArrayAdapter;

/**
* @group time-sensitive
*/
class PhpArrayAdapterWithFallbackTest extends CachePoolTest
class PhpArrayAdapterWithFallbackTest extends AdapterTestCase
{
protected $skippedTests = array(
'testGetItemInvalidKeys' => 'PhpArrayAdapter does not throw exceptions on invalid key.',
'testGetItemsInvalidKeys' => 'PhpArrayAdapter does not throw exceptions on invalid key.',
'testHasItemInvalidKeys' => 'PhpArrayAdapter does not throw exceptions on invalid key.',
'testDeleteItemInvalidKeys' => 'PhpArrayAdapter does not throw exceptions on invalid key.',
'testDeleteItemsInvalidKeys' => 'PhpArrayAdapter does not throw exceptions on invalid key.',
'testDefaultLifeTime' => 'PhpArrayAdapter does not allow configuring a default lifetime.',
);

private static $file;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@

namespace Symfony\Component\Cache\Tests\Adapter;

use Cache\IntegrationTests\CachePoolTest;
use Symfony\Component\Cache\Adapter\PhpFilesAdapter;

/**
* @group time-sensitive
*/
class PhpFilesAdapterTest extends CachePoolTest
class PhpFilesAdapterTest extends AdapterTestCase
{
protected $skippedTests = array(
'testDefaultLifeTime' => 'PhpFilesAdapter does not allow configuring a default lifetime.',
);

public function createCachePool()
{
if (defined('HHVM_VERSION')) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ public static function setupBeforeClass()
self::$redis->connect('127.0.0.1');
}

public function createCachePool()
public function createCachePool($defaultLifeTime = 0)
{
if (defined('HHVM_VERSION')) {
$this->skippedTests['testDeferredSaveWithoutCommit'] = 'Fails on HHVM';
}

return new TagAwareRedisAdapter(self::$redis, str_replace('\\', '.', __CLASS__));
return new TagAwareRedisAdapter(self::$redis, str_replace('\\', '.', __CLASS__), $defaultLifeTime);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ public static function setupBeforeClass()
self::$redis->connect('127.0.0.1');
}

public function createCachePool()
public function createCachePool($defaultLifeTime = 0)
{
if (defined('HHVM_VERSION')) {
$this->skippedTests['testDeferredSaveWithoutCommit'] = 'Fails on HHVM';
}

return new TagAwareRedisAdapter(self::$redis, str_replace('\\', '.', __CLASS__), 0, new ArrayAdapter());
return new TagAwareRedisAdapter(self::$redis, str_replace('\\', '.', __CLASS__), 0, new ArrayAdapter($defaultLifeTime));
}
}