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

LanguageTest::testGetIndex()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
namespace Redaxscript\Tests;
3
4
/**
5
 * LanguageTest
6
 *
7
 * @since 2.2.0
8
 *
9
 * @package Redaxscript
10
 * @category Tests
11
 * @author Henry Ruhs
12
 *
13
 * @covers Redaxscript\Language
14
 */
15
16
class LanguageTest extends TestCaseAbstract
17
{
18
	/**
19
	 * testInit
20
	 *
21
	 * @since 3.0.0
22
	 */
23
24
	public function testInit() : void
25
	{
26
		/* setup */
27
28
		$this->_language->init('de');
29
		$this->_language->init('en');
30
31
		/* actual */
32
33
		$actual = $this->_language;
34
35
		/* compare */
36
37
		$this->assertInstanceOf('Redaxscript\Language', $actual);
38
	}
39
40
	/**
41
	 * testGetAndSet
42
	 *
43
	 * @since 2.4.0
44
	 */
45
46
	public function testGetAndSet() : void
47
	{
48
		/* setup */
49
50
		$this->_language->set('testKey', 'testValue');
51
52
		/* actual */
53
54
		$actual = $this->_language->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
		/* actual */
70
71
		$actualArray = $this->_language->getArray();
72
73
		/* compare */
74
75
		$this->assertArrayHasKey('home', $actualArray);
76
	}
77
78
	/**
79
	 * testGetInvalid
80
	 *
81
	 * @since 2.2.0
82
	 */
83
84
	public function testGetInvalid() : void
85
	{
86
		/* actual */
87
88
		$actual = $this->_language->get('invalidKey');
89
90
		/* compare */
91
92
		$this->assertNull($actual);
93
	}
94
}
95