TestSession   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 27
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 6 1
A testGet() 0 5 1
A tearDown() 0 6 1
1
<?php
2
namespace ChatApp\Tests;
3
4
use PHPUnit_Framework_TestCase;
5
use ChatApp\Session;
6
7
class TestSession
8
    extends
9
        PHPUnit_Framework_TestCase
10
{
11
12
    protected $array;
13
14
    public function setUp()
15
    {
16
        $this->array['key'] = 'test';
17
        $this->array['value'] = 'test';
18
        Session::put($this->array['key'], $this->array['value']);
19
    }
20
21
    public function testGet()
22
    {
23
        $value = Session::get($this->array['key']);
24
        $this->assertEquals($this->array['value'], $value);
25
    }
26
27
    public function tearDown()
28
    {
29
        Session::forget($this->array['key']);
30
        $value = Session::get($this->array['key']);
31
        $this->assertEquals(null, $value);
32
    }
33
}
34
35