Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 64ace10

Browse files
Merge branch '3.1'
* 3.1: [Cache] Skip tests that sleep() but can't be clock-mocked
2 parents 973f295 + 49a2cb8 commit 64ace10

8 files changed

+24
-2
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515

1616
abstract class AbstractRedisAdapterTest extends AdapterTestCase
1717
{
18+
protected $skippedTests = array(
19+
'testExpiration' => 'Testing expiration slows down the test suite',
20+
'testHasItemReturnsFalseWhenDeferredItemIsExpired' => 'Testing expiration slows down the test suite',
21+
'testDefaultLifeTime' => 'Testing expiration slows down the test suite',
22+
);
23+
1824
protected static $redis;
1925

2026
public function createCachePool($defaultLifetime = 0)

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515

1616
class ApcuAdapterTest extends AdapterTestCase
1717
{
18+
protected $skippedTests = array(
19+
'testExpiration' => 'Testing expiration slows down the test suite',
20+
'testHasItemReturnsFalseWhenDeferredItemIsExpired' => 'Testing expiration slows down the test suite',
21+
'testDefaultLifeTime' => 'Testing expiration slows down the test suite',
22+
);
23+
1824
public function createCachePool($defaultLifetime = 0)
1925
{
2026
if (!function_exists('apcu_fetch') || !ini_get('apc.enabled') || ('cli' === PHP_SAPI && !ini_get('apc.enable_cli'))) {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
/**
2020
* @author Kévin Dunglas <[email protected]>
21+
* @group time-sensitive
2122
*/
2223
class ChainAdapterTest extends AdapterTestCase
2324
{

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ class DoctrineAdapterTest extends AdapterTestCase
2626

2727
public function createCachePool($defaultLifetime = 0)
2828
{
29-
return new DoctrineAdapter(new ArrayCache(), '', $defaultLifetime);
29+
return new DoctrineAdapter(new ArrayCache($defaultLifetime), '', $defaultLifetime);
3030
}
3131
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ class NamespacedProxyAdapterTest extends ProxyAdapterTest
2121
{
2222
public function createCachePool($defaultLifetime = 0)
2323
{
24-
return new ProxyAdapter(new ArrayAdapter(), 'foo', $defaultLifetime);
24+
return new ProxyAdapter(new ArrayAdapter($defaultLifetime), 'foo', $defaultLifetime);
2525
}
2626
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
use Psr\Cache\CacheItemInterface;
1515
use Symfony\Component\Cache\Adapter\NullAdapter;
1616

17+
/**
18+
* @group time-sensitive
19+
*/
1720
class NullAdapterTest extends \PHPUnit_Framework_TestCase
1821
{
1922
public function createCachePool()

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
use Symfony\Component\Cache\Adapter\NullAdapter;
1616
use Symfony\Component\Cache\Adapter\PhpArrayAdapter;
1717

18+
/**
19+
* @group time-sensitive
20+
*/
1821
class PhpArrayAdapterTest extends AdapterTestCase
1922
{
2023
protected $skippedTests = array(

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ class TagAwareRedisArrayAdapterTest extends AbstractRedisAdapterTest
2121
protected $skippedTests = array(
2222
'testDeferredSaveWithoutCommit' => 'Assumes a shared cache which ArrayAdapter is not.',
2323
'testSaveWithoutExpire' => 'Assumes a shared cache which ArrayAdapter is not.',
24+
'testExpiration' => 'Testing expiration slows down the test suite',
25+
'testHasItemReturnsFalseWhenDeferredItemIsExpired' => 'Testing expiration slows down the test suite',
26+
'testDefaultLifeTime' => 'Testing expiration slows down the test suite',
2427
);
2528

2629
public static function setupBeforeClass()

0 commit comments

Comments
 (0)