Completed
Pull Request — 5.1 (#1327)
by
unknown
05:23
created

liteTest::testClear()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 0
nc 1
nop 0
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
<?php
2
// +----------------------------------------------------------------------
1 ignored issue
show
Coding Style introduced by
You must use "/**" style comments for a file comment
Loading history...
3
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
4
// +----------------------------------------------------------------------
5
// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved.
6
// +----------------------------------------------------------------------
7
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
8
// +----------------------------------------------------------------------
9
// | Author: liu21st <[email protected]>
10
// +----------------------------------------------------------------------
11
12
/**
13
 * Lite缓存驱动测试
14
 * @author    刘志淳 <[email protected]>
1 ignored issue
show
Coding Style introduced by
Tag value indented incorrectly; expected 1 spaces but found 4
Loading history...
15
 */
16
17
namespace tests\thinkphp\library\think\cache\driver;
18
19
use think\Cache;
0 ignored issues
show
Bug introduced by
The type think\Cache was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
20
21
class liteTest extends \PHPUnit_Framework_TestCase
1 ignored issue
show
Bug introduced by
The type PHPUnit_Framework_TestCase was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
Coding Style introduced by
Missing class doc comment
Loading history...
Coding Style introduced by
Class name must begin with a capital letter
Loading history...
22
{
23
    protected function getCacheInstance()
0 ignored issues
show
Coding Style introduced by
Missing function doc comment
Loading history...
24
    {
25
        return Cache::connect(['type' => 'Lite', 'path' => CACHE_PATH]);
0 ignored issues
show
Bug introduced by
The constant tests\thinkphp\library\t...cache\driver\CACHE_PATH was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
26
    }
27
28
    /**
29
     * 测试缓存读取
30
     * @return  mixed
1 ignored issue
show
Coding Style introduced by
Tag value indented incorrectly; expected 1 spaces but found 2
Loading history...
31
     * @access public
32
     */
33
    public function testGet()
34
    {
35
        $cache = $this->getCacheInstance();
36
        $this->assertFalse($cache->get('test'));
37
    }
38
39
    /**
40
     * 测试缓存设置
41
     * @return  mixed
1 ignored issue
show
Coding Style introduced by
Tag value indented incorrectly; expected 1 spaces but found 2
Loading history...
42
     * @access public
43
     */
44
    public function testSet()
45
    {
46
        $cache = $this->getCacheInstance();
47
        $this->assertNotEmpty($cache->set('test', 'test'));
48
    }
49
50
    /**
51
     * 删除缓存测试
52
     * @return  mixed
1 ignored issue
show
Coding Style introduced by
Tag value indented incorrectly; expected 1 spaces but found 2
Loading history...
53
     * @access public
54
     */
55
    public function testRm()
56
    {
57
        $cache = $this->getCacheInstance();
58
        $this->assertTrue($cache->rm('test'));
59
    }
60
61
    /**
62
     * 清空缓存测试
63
     * @return  mixed
1 ignored issue
show
Coding Style introduced by
Tag value indented incorrectly; expected 1 spaces but found 2
Loading history...
64
     * @access public
65
     */
66
    public function testClear()
67
    {
68
    }
69
}
70