8000 minor #19464 [Cache] Use AdapterTestCase for new adapters (nicolas-gr… · symfony/symfony@ec3a4ed · GitHub
[go: up one dir, main page]

Skip to content

Commit ec3a4ed

Browse files
minor #19464 [Cache] Use AdapterTestCase for new adapters (nicolas-grekas)
This PR was merged into the 3.2-dev branch. Discussion ---------- [Cache] Use AdapterTestCase for new adapters | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Commits ------- cbc1e54 [Cache] Use AdapterTestCase for new adapters
2 parents b6bbe43 + cbc1e54 commit ec3a4ed

File tree

5 files changed

+14
-10
lines changed

5 files changed

+14
-10
lines changed

src/Symfony/Component/Cache/Tests/Adapter/PhpArrayAdapterTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@
1111

1212
namespace Symfony\Component\Cache\Tests\Adapter;
1313

14-
use Cache\IntegrationTests\CachePoolTest;
1514
use Psr\Cache\CacheItemInterface;
1615
use Symfony\Component\Cache\Adapter\NullAdapter;
1716
use Symfony\Component\Cache\Adapter\PhpArrayAdapter;
1817

19-
class PhpArrayAdapterTest extends CachePoolTest
18+
class PhpArrayAdapterTest extends AdapterTestCase
2019
{
2120
protected $skippedTests = array(
2221
'testBasicUsage' => 'PhpArrayAdapter is read-only.',
@@ -45,6 +44,8 @@ class PhpArrayAdapterTest extends CachePoolTest
4544
'testHasItemInvalidKeys' => 'PhpArrayAdapter does not throw exceptions on invalid key.',
4645
'testDeleteItemInvalidKeys' => 'PhpArrayAdapter does not throw exceptions on invalid key.',
4746
'testDeleteItemsInvalidKeys' => 'PhpArrayAdapter does not throw exceptions on invalid key.',
47+
48+
'testDefaultLifeTime' => 'PhpArrayAdapter does not allow configuring a default lifetime.',
4849
);
4950

5051
private static $file;

src/Symfony/Component/Cache/Tests/Adapter/PhpArrayAdapterWithFallbackTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,21 @@
1111

1212
namespace Symfony\Component\Cache\Tests\Adapter;
1313

14-
use Cache\IntegrationTests\CachePoolTest;
1514
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
1615
use Symfony\Component\Cache\Adapter\PhpArrayAdapter;
1716

1817
/**
1918
* @group time-sensitive
2019
*/
21-
class PhpArrayAdapterWithFallbackTest extends CachePoolTest
8000 20+
class PhpArrayAdapterWithFallbackTest extends AdapterTestCase
2221
{
2322
protected $skippedTests = array(
2423
'testGetItemInvalidKeys' => 'PhpArrayAdapter does not throw exceptions on invalid key.',
2524
'testGetItemsInvalidKeys' => 'PhpArrayAdapter does not throw exceptions on invalid key.',
2625
'testHasItemInvalidKeys' => 'PhpArrayAdapter does not throw exceptions on invalid key.',
2726
'testDeleteItemInvalidKeys' => 'PhpArrayAdapter does not throw exceptions on invalid key.',
2827
'testDeleteItemsInvalidKeys' => 'PhpArrayAdapter does not throw exceptions on invalid key.',
28+
'testDefaultLifeTime' => 'PhpArrayAdapter does not allow configuring a default lifetime.',
2929
);
3030

3131
private static $file;

src/Symfony/Component/Cache/Tests/Adapter/PhpFilesAdapterTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,17 @@
1111

1212
namespace Symfony\Component\Cache\Tests\Adapter;
1313

14-
use Cache\IntegrationTests\CachePoolTest;
1514
use Symfony\Component\Cache\Adapter\PhpFilesAdapter;
1615

1716
/**
1817
* @group time-sensitive
1918
*/
20-
class PhpFilesAdapterTest extends CachePoolTest
19+
class PhpFilesAdapterTest extends AdapterTestCase
2120
{
21+
protected $skippedTests = array(
22+
'testDefaultLifeTime' => 'PhpFilesAdapter does not allow configuring a default lifetime.',
23+
);
24+
2225
public function createCachePool()
2326
{
2427
if (defined('HHVM_VERSION')) {

src/Symfony/Component/Cache/Tests/Adapter/TagAwareRedisAdapterTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ public static function setupBeforeClass()
2424
self::$redis->connect('127.0.0.1');
2525
}
2626

27-
public function createCachePool()
27+
public function createCachePool($defaultLifeTime = 0)
2828
{
2929
if (defined('HHVM_VERSION')) {
3030
$this->skippedTests['testDeferredSaveWithoutCommit'] = 'Fails on HHVM';
3131
}
3232

33-
return new TagAwareRedisAdapter(self::$redis, str_replace('\\', '.', __CLASS__));
33+
return new TagAwareRedisAdapter(self::$redis, str_replace('\\', '.', __CLASS__), $defaultLifeTime);
3434
}
3535
}

src/Symfony/Component/Cache/Tests/Adapter/TagAwareRedisArrayAdapterTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ public static function setupBeforeClass()
3030
self::$redis->connect('127.0.0.1');
3131
}
3232

33-
public function createCachePool()
33+
public function createCachePool($defaultLifeTime = 0)
3434
{
3535
if (defined('HHVM_VERSION')) {
3636
$this->skippedTests['testDeferredSaveWithoutCommit'] = 'Fails on HHVM';
3737
}
3838

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

0 commit comments

Comments
 (0)
0