ZendCacheIntegrationTest::setUp()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 18
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 18
rs 9.4285
cc 2
eloc 10
nc 2
nop 0
1
<?php
2
3
namespace Onoi\Cache\Tests\Integration;
4
5
use Zend\Cache\StorageFactory;
6
use Onoi\Cache\ZendCache;
7
8
/**
9
 * @group onoi-cache
10
 *
11
 * @license GNU GPL v2+
12
 * @since 1.1
13
 *
14
 * @author mwjames
15
 */
16
class ZendCacheIntegrationTest extends CacheIntegrationTestCase {
17
18
	protected $cache;
19
20
	protected function setUp() {
21
22
		if ( !class_exists( '\Zend\Cache\StorageFactory' ) ) {
23
			$this->markTestSkipped( 'StorageFactory is not available' );
24
		}
25
26
		$memoryCache = StorageFactory::factory( array(
27
			'adapter' => array(
28
				'name'    => 'memory',
29
				'options' => array( 'ttl' => 100 ),
30
			),
31
				'plugins' => array(
32
				'exception_handler' => array( 'throw_exceptions' => false ),
33
			),
34
		) );
35
36
		$this->cache = new ZendCache( $memoryCache );
37
	}
38
39
}
40