testStorageAndRetrieval()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 23
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 23
rs 9.0856
cc 1
eloc 12
nc 1
nop 0
1
<?php
2
3
namespace Onoi\Cache\Tests\Integration;
4
5
/**
6
 * @group onoi-cache
7
 *
8
 * @license GNU GPL v2+
9
 * @since 1.2
10
 *
11
 * @author mwjames
12
 */
13
abstract class CacheIntegrationTestCase extends \PHPUnit_Framework_TestCase {
14
15
	protected $cache;
16
17
	public function testStorageAndRetrieval() {
18
19
		$this->assertFalse(
20
			$this->cache->contains( 'Foo' )
21
		);
22
23
		$this->cache->save( 'Foo', 'Bar', 42 );
24
25
		$this->assertTrue(
26
			$this->cache->contains( 'Foo' )
27
		);
28
29
		$this->assertEquals(
30
			'Bar',
31
			$this->cache->fetch( 'Foo' )
32
		);
33
34
		$this->cache->delete( 'Foo' );
35
36
		$this->assertFalse(
37
			$this->cache->contains( 'Foo' )
38
		);
39
	}
40
41
}
42