NullCacheTest   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 67
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 67
c 0
b 0
f 0
wmc 7
lcom 0
cbo 1
rs 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A testCanConstruct() 0 7 1
A testGetName() 0 8 1
A testSave() 0 9 1
A testDelete() 0 9 1
A testContains() 0 8 1
A testFetch() 0 8 1
A testGetStats() 0 8 1
1
<?php
2
3
namespace Onoi\Cache\Tests;
4
5
use Onoi\Cache\NullCache;
6
7
/**
8
 * @covers \Onoi\Cache\NullCache
9
 *
10
 * @group onoi-cache
11
 *
12
 * @license GNU GPL v2+
13
 * @since 1.1
14
 *
15
 * @author mwjames
16
 */
17
class NullCacheTest extends \PHPUnit_Framework_TestCase {
18
19
	public function testCanConstruct() {
20
21
		$this->assertInstanceOf(
22
			'\Onoi\Cache\NullCache',
23
			new NullCache()
24
		);
25
	}
26
27
	public function testGetName() {
28
29
		$instance = new NullCache();
30
31
		$this->assertEmpty(
32
			$instance->getName()
33
		);
34
	}
35
36
	public function testSave() {
37
38
		$instance = new NullCache();
39
		$instance->save( 'Foo', 'Bar', 42 );
40
41
		$this->assertFalse(
42
			$instance->contains( 'Foo' )
43
		);
44
	}
45
46
	public function testDelete() {
47
48
		$instance = new NullCache();
49
		$instance->delete( 'Foo' );
50
51
		$this->assertFalse(
52
			$instance->contains( 'Foo' )
53
		);
54
	}
55
56
	public function testContains() {
57
58
		$instance = new NullCache();
59
60
		$this->assertFalse(
61
			$instance->contains( 'Foo' )
62
		);
63
	}
64
65
	public function testFetch() {
66
67
		$instance = new NullCache();
68
69
		$this->assertFalse(
70
			$instance->fetch( 'Foo' )
71
		);
72
	}
73
74
	public function testGetStats() {
75
76
		$instance = new NullCache();
77
78
		$this->assertEmpty(
79
			$instance->getStats()
80
		);
81
	}
82
83
}
84