LanguageTest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 79
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 79
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A testGetArray() 0 10 1
A testInit() 0 15 1
A testGetAndSet() 0 14 1
A testGetInvalid() 0 10 1
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