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

ItemTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 5
Bugs 1 Features 0
Metric Value
wmc 2
c 5
b 1
f 0
lcom 1
cbo 2
dl 0
loc 40
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\Item\Item;
10
11
/**
12
 * Tests for the Joomla\Cache\Item class.
13
 *
14
 * @since  1.0
15
 */
16
class ItemTest extends \PHPUnit_Framework_TestCase
17
{
18
	/**
19
	 * @var    Item
20
	 * @since  1.0
21
	 */
22
	private $instance;
23
24
	/**
25
	 * Tests the Joomla\Cache\Item class.
26
	 *
27
	 * @return  void
28
	 *
29
	 * @since   1.0
30
	 */
31
	public function testItem()
32
	{
33
		$this->assertEquals('foo', $this->instance->getKey());
34
		$this->assertNull($this->instance->get());
35
		$this->assertFalse($this->instance->isHit());
36
37
		$this->instance->set('bar');
38
		$this->assertEquals('bar', $this->instance->get());
39
		$this->assertTrue($this->instance->isHit());
40
	}
41
42
	/**
43
	 * Setup the tests.
44
	 *
45
	 * @return  void
46
	 *
47
	 * @since   1.0
48
	 */
49
	protected function setUp()
50
	{
51
		parent::setUp();
52
53
		$this->instance = new Item('foo');
54
	}
55
}
56