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

fileTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 26
rs 10
c 0
b 0
f 0
wmc 4

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testExpire() 0 2 1
A getCacheInstance() 0 6 2
A setUp() 0 3 1
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
 * File缓存驱动测试
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
class fileTest extends cacheTestCase
1 ignored issue
show
Coding Style introduced by
Missing class doc comment
Loading history...
Coding Style introduced by
Class name must begin with a capital letter
Loading history...
20
{
21
    private $_cacheInstance = null;
22
23
    /**
24
     * 基境缓存类型
25
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
26
    protected function setUp()
27
    {
28
        \think\Cache::connect(['type' => 'File', 'path' => CACHE_PATH]);
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...
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...
29
    }
30
31
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
32
     * @return FileCache
0 ignored issues
show
Bug introduced by
The type tests\thinkphp\library\t...\cache\driver\FileCache 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...
33
     */
34
    protected function getCacheInstance()
35
    {
36
        if (null === $this->_cacheInstance) {
37
            $this->_cacheInstance = new \think\cache\driver\File();
0 ignored issues
show
Bug introduced by
The type think\cache\driver\File 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...
38
        }
39
        return $this->_cacheInstance;
40
    }
41
42
    // skip testExpire
43
    public function testExpire()
0 ignored issues
show
Coding Style introduced by
You must use "/**" style comments for a function comment
Loading history...
44
    {
45
    }
46
}
47