Completed
Push — 2.0-dev ( 13430b...59c481 )
by George
07:19
created

XCacheTest   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 112
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 2

Importance

Changes 6
Bugs 0 Features 0
Metric Value
wmc 8
c 6
b 0
f 0
lcom 2
cbo 2
dl 0
loc 112
rs 10
1
<?php
2
/**
3
 * @copyright  Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
4
 * @license    GNU General Public License version 2 or later; see LICENSE
5
 */
6
7
namespace Joomla\Cache\Tests;
8
9
use Joomla\Cache;
10
11
/**
12
 * Tests for the Joomla\Cache\XCache class.
13
 *
14
 * @since  1.0
15
 */
16
class XCacheTest extends \PHPUnit_Framework_TestCase
17
{
18
	/**
19
	 * @var    Cache\XCache
20
	 * @since  1.0
21
	 */
22
	private $instance;
23
24
	/**
25
	 * Tests for the correct Psr\Cache return values.
26
	 *
27
	 * @return  void
28
	 *
29
	 * @coversNothing
30
	 * @since   1.0
31
	 */
32
	public function testPsrCache()
33
	{
34
		$this->assertInternalType('boolean', $this->instance->clear(), 'Checking clear.');
35
		$this->assertInstanceOf('\Psr\Cache\CacheItemInterface', $this->instance->getItem('foo'), 'Checking get.');
36
		$this->assertInternalType('array', $this->instance->getItems(array('foo')), 'Checking getMultiple.');
37
		$this->assertInternalType('boolean', $this->instance->deleteItem('foo'), 'Checking remove.');
38
		$this->assertInternalType('array', $this->instance->deleteItems(array('foo')), 'Checking removeMultiple.');
39
		$this->assertInternalType('boolean', $this->instance->set('for', 'bar'), 'Checking set.');
40
	}
41
42
	/**
43
	 * Tests the Joomla\Cache\XCache::clear method.
44
	 *
45
	 * @return  void
46
	 *
47
	 * @covers  Joomla\Cache\XCache::clear
48
	 * @since   1.0
49
	 */
50
	public function testClear()
51
	{
52
		$this->markTestIncomplete();
53
	}
54
55
	/**
56
	 * Tests the Joomla\Cache\XCache::hasItem method.
57
	 *
58
	 * @return  void
59
	 *
60
	 * @covers  Joomla\Cache\XCache::hasItem
61
	 * @since   1.0
62
	 */
63
	public function testHasItem()
64
	{
65
		$this->markTestIncomplete();
66
	}
67
68
	/**
69
	 * Tests the Joomla\Cache\XCache::getItem method.
70
	 *
71
	 * @return  void
72
	 *
73
	 * @covers  Joomla\Cache\XCache::getItem
74
	 * @since   1.0
75
	 */
76
	public function testGetItem()
77
	{
78
		$this->markTestIncomplete();
79
	}
80
81
	/**
82
	 * Tests the Joomla\Cache\XCache::deleteItem method.
83
	 *
84
	 * @return  void
85
	 *
86
	 * @covers  Joomla\Cache\XCache::deleteItem
87
	 * @since   1.0
88
	 */
89
	public function testDeleteItem()
90
	{
91
		$this->markTestIncomplete();
92
	}
93
94
	/**
95
	 * Tests the Joomla\Cache\XCache::set method.
96
	 *
97
	 * @return  void
98
	 *
99
	 * @covers  Joomla\Cache\XCache::set
100
	 * @since   1.0
101
	 */
102
	public function testSet()
103
	{
104
		$this->markTestIncomplete();
105
	}
106
107
	/**
108
	 * Setup the tests.
109
	 *
110
	 * @return  void
111
	 *
112
	 * @since   1.0
113
	 */
114
	protected function setUp()
115
	{
116
		parent::setUp();
117
118
		try
119
		{
120
			$this->instance = new Cache\XCache;
121
		}
122
		catch (\Exception $e)
123
		{
124
			$this->markTestSkipped();
125
		}
126
	}
127
}
128