From e3a95fe99459caaf510c1c51ebd9ef0be6a43b65 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sun, 28 Feb 2016 22:37:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=BC=93=E5=AD=98=E9=A9=B1?= =?UTF-8?q?=E5=8A=A8=E7=9A=84queue=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/thinkphp/library/think/cache/driver/apcTest.php | 10 ---------- .../library/think/cache/driver/cacheTestCase.php | 11 +++++++++++ .../library/think/cache/driver/memcachedTest.php | 2 +- .../thinkphp/library/think/cache/driver/redisTest.php | 2 +- 4 files changed, 13 insertions(+), 12 deletions(-) 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; }