diff --git a/tests/thinkphp/library/think/cache/driver/testTest.php b/tests/thinkphp/library/think/cache/driver/testTest.php new file mode 100644 index 00000000..cb6ae573 --- /dev/null +++ b/tests/thinkphp/library/think/cache/driver/testTest.php @@ -0,0 +1,70 @@ + +// +---------------------------------------------------------------------- + +/** + * Test缓存驱动测试 + * @author 刘志淳 + */ + +namespace tests\thinkphp\library\think\cache\driver; + +use think\Cache; + +class testTest extends \PHPUnit_Framework_TestCase +{ + /** + * 测试缓存读取 + * @return mixed + * @access public + */ + public function testGet() + { + $cache = Cache::connect(['type' => 'Test']); + + $this->assertFalse($cache->get('test')); + } + + /** + * 测试缓存设置 + * @return mixed + * @access public + */ + public function testSet() + { + $cache = Cache::connect(['type' => 'Test']); + + $this->assertTrue($cache->set('test', 'test')); + } + + /** + * 删除缓存测试 + * @return mixed + * @access public + */ + public function testRm() + { + $cache = Cache::connect(['type' => 'Test']); + + $this->assertTrue($cache->rm('test')); + } + + /** + * 清空缓存测试 + * @return mixed + * @access public + */ + public function testClear() + { + $cache = Cache::connect(['type' => 'Test']); + + $this->assertTrue($cache->clear()); + } +}