Completed
Push — master ( da58d4...61a0f7 )
by Henry
06:34
created

RegistryTest::testGetArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 9.7998
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
namespace Redaxscript\Tests;
3
4
/**
5
 * RegistryTest
6
 *
7
 * @since 2.1.0
8
 *
9
 * @package Redaxscript
10
 * @category Tests
11
 * @author Henry Ruhs
12
 * @author Gary Aylward
13
 *
14
 * @covers Redaxscript\Registry
15
 */
16
17
class RegistryTest extends TestCaseAbstract
18
{
19
	/**
20
	 * testInit
21
	 *
22
	 * @since 3.0.0
23
	 */
24
25
	public function testInit() : void
26
	{
27
		/* setup */
28
29
		$this->_registry->init();
30
31
		/* actual */
32
33
		$actual = $this->_registry;
34
35
		/* compare */
36
37
		$this->assertInstanceOf('Redaxscript\Registry', $actual);
38
	}
39
40
	/**
41
	 * testGetAndSet
42
	 *
43
	 * @since 2.1.0
44
	 */
45
46
	public function testGetAndSet() : void
47
	{
48
		/* setup */
49
50
		$this->_registry->set('testKey', 'testValue');
51
52
		/* actual */
53
54
		$actual = $this->_registry->get('testKey');
55
56
		/* compare */
57
58
		$this->assertEquals('testValue', $actual);
59
	}
60
61
	/**
62
	 * testGetArray
63
	 *
64
	 * @since 4.0.0
65
	 */
66
67
	public function testGetArray() : void
68
	{
69
		/* setup */
70
71
		$this->_registry->set('testKey', 'testValue');
72
73
		/* actual */
74
75
		$actualArray = $this->_registry->getArray();
76
77
		/* compare */
78
79
		$this->assertArrayHasKey('testKey', $actualArray);
80
	}
81
82
	/**
83
	 * testGetInvalid
84
	 *
85
	 * @since 2.1.0
86
	 */
87
88
	public function testGetInvalid() : void
89
	{
90
		/* actual */
91
92
		$actual = $this->_registry->get('invalidKey');
93
94
		/* compare */
95
96
		$this->assertNull($actual);
97
	}
98
}
99