diff --git a/tests/thinkphp/library/think/cache/driver/apcTest.php b/tests/thinkphp/library/think/cache/driver/apcTest.php index 373ba003..92e3c131 100644 --- a/tests/thinkphp/library/think/cache/driver/apcTest.php +++ b/tests/thinkphp/library/think/cache/driver/apcTest.php @@ -50,14 +50,4 @@ class apcTest extends cacheTestCase { } - public function testQueue() - { - $cache = $this->getCacheInstance(); - $this->assertTrue($cache->set('1', '1')); - $this->assertTrue($cache->set('2', '2')); - $this->assertTrue($cache->set('3', '3')); - $this->assertEquals(1, $cache->get('1')); - $this->assertTrue($cache->set('4', '4')); - $this->assertFalse($cache->get('1')); - } } diff --git a/tests/thinkphp/library/think/cache/driver/cacheTestCase.php b/tests/thinkphp/library/think/cache/driver/cacheTestCase.php index 328296d3..75ecc816 100644 --- a/tests/thinkphp/library/think/cache/driver/cacheTestCase.php +++ b/tests/thinkphp/library/think/cache/driver/cacheTestCase.php @@ -159,4 +159,15 @@ abstract class cacheTestCase extends \PHPUnit_Framework_TestCase $this->assertEquals('a', Cache::get('a')); $this->assertNotNull(Cache::rm('a')); } + + public function testQueue() + { + $cache = $this->prepare(); + $this->assertTrue($cache->set('1', '1')); + $this->assertTrue($cache->set('2', '2')); + $this->assertTrue($cache->set('3', '3')); + $this->assertEquals(1, $cache->get('1')); + $this->assertTrue($cache->set('4', '4')); + $this->assertFalse($cache->get('1')); + } } diff --git a/tests/thinkphp/library/think/cache/driver/memcachedTest.php b/tests/thinkphp/library/think/cache/driver/memcachedTest.php index 051083c2..05b0877f 100644 --- a/tests/thinkphp/library/think/cache/driver/memcachedTest.php +++ b/tests/thinkphp/library/think/cache/driver/memcachedTest.php @@ -35,7 +35,7 @@ class memcachedTest extends cacheTestCase protected function getCacheInstance() { if (null === $this->_cacheInstance) { - $this->_cacheInstance = new \think\cache\driver\Memcached(); + $this->_cacheInstance = new \think\cache\driver\Memcached(['length' => 3]); } return $this->_cacheInstance; } diff --git a/tests/thinkphp/library/think/cache/driver/redisTest.php b/tests/thinkphp/library/think/cache/driver/redisTest.php index c40cb68b..577cbe2a 100644 --- a/tests/thinkphp/library/think/cache/driver/redisTest.php +++ b/tests/thinkphp/library/think/cache/driver/redisTest.php @@ -31,7 +31,7 @@ class redisTest extends cacheTestCase protected function getCacheInstance() { if (null === $this->_cacheInstance) { - $this->_cacheInstance = new \think\cache\driver\Redis(); + $this->_cacheInstance = new \think\cache\driver\Redis(['length' => 3]); } return $this->_cacheInstance; }