Completed
Push — master ( 432a29...e6b984 )
by Henry
06:52
created

DetectorTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 4
dl 0
loc 43
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 5 1
A testDetector() 0 18 1
1
<?php
2
namespace Redaxscript\Tests\Bootstrap;
3
4
use Redaxscript\Bootstrap;
5
use Redaxscript\Tests\TestCaseAbstract;
6
7
/**
8
 * DetectorTest
9
 *
10
 * @since 3.1.0
11
 *
12
 * @package Redaxscript
13
 * @category Tests
14
 * @author Henry Ruhs
15
 *
16
 * @covers Redaxscript\Bootstrap\BootstrapAbstract
17
 * @covers Redaxscript\Bootstrap\Detector
18
 *
19
 * @runTestsInSeparateProcesses
20
 */
21
22
class DetectorTest extends TestCaseAbstract
23
{
24
	/**
25
	 * setUp
26
	 *
27
	 * @since 5.0.0
28
	 */
29
30
	public function setUp() : void
31
	{
32
		parent::setUp();
33
		$this->_request->init();
34
	}
35
36
	/**
37
	 * testDetector
38
	 *
39
	 * @since 3.1.0
40
	 *
41
	 * @param array $expectArray
42
	 *
43
	 * @dataProvider providerAutoloader
44
	 */
45
46
	public function testDetector(array $expectArray = []) : void
47
	{
48
		/* setup */
49
50
		new Bootstrap\Detector($this->_registry, $this->_request);
51
52
		/* actual */
53
54
		$actualArray =
55
		[
56
			'language' => $this->_registry->get('language'),
57
			'template' => $this->_registry->get('template')
58
		];
59
60
		/* compare */
61
62
		$this->assertEquals($expectArray, $actualArray);
63
	}
64
}
65