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

SessionTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
namespace Redaxscript\Tests\Bootstrap;
3
4
use Redaxscript\Bootstrap;
5
use Redaxscript\Tests\TestCaseAbstract;
6
7
/**
8
 * SessionTest
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\Session
18
 *
19
 * @runTestsInSeparateProcesses
20
 */
21
22
class SessionTest 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
	 * testSession
38
	 *
39
	 * @since 3.1.0
40
	 *
41
	 * @param array $expectArray
42
	 *
43
	 * @dataProvider providerAutoloader
44
	 */
45
46
	public function testSession(array $expectArray = []) : void
47
	{
48
		/* setup */
49
50
		new Bootstrap\Session($this->_registry, $this->_request);
51
52
		/* actual */
53
54
		$actualArray =
55
		[
56
			'registry' =>
57
			[
58
				'sessionStatus' => $this->_registry->get('sessionStatus')
59
			],
60
			'session' =>
61
			[
62
				'sessionGuard' => $this->_request->getSession('sessionGuard')
63
			]
64
		];
65
66
		/* compare */
67
68
		$this->assertEquals($expectArray, $actualArray);
69
	}
70
}
71