Total Complexity | 4 |
Total Lines | 25 |
Duplicated Lines | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | class SessionTest extends Unit |
||
11 | { |
||
12 | private Session $session; |
||
13 | |||
14 | protected function _before() |
||
15 | { |
||
16 | $this->session = new Session(['username' => 'johndoe']); |
||
17 | } |
||
18 | |||
19 | public function testGet() |
||
20 | { |
||
21 | $this->assertEquals('johndoe', $this->session->get('username')); |
||
22 | $this->assertNull($this->session->get('password')); |
||
23 | } |
||
24 | |||
25 | public function testSet() |
||
26 | { |
||
27 | $this->session->set('username', 'janedoe'); |
||
28 | $this->assertEquals('janedoe', $this->session->get('username')); |
||
29 | } |
||
30 | |||
31 | public function testDelete() |
||
32 | { |
||
33 | $this->session->delete('username'); |
||
34 | $this->assertNull($this->session->get('username')); |
||
35 | } |
||
37 |