RouterResponseTest   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 72
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 8 1
A testGetStatusCode() 0 4 1
A testGetHandler() 0 4 1
A testGetVars() 0 4 1
A testGetNames() 0 4 1
1
<?php
2
/**
3
 * This file is part of the DS Framework.
4
 *
5
 * (c) Dan Smith <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace Tests\Ds\Router;
11
12
use Ds\Router\RouterResponse;
13
14
/**
15
 * Class RouterResponseTest
16
 * @package Tests\Ds\Router
17
 */
18
class RouterResponseTest extends \PHPUnit_Framework_TestCase
19
{
20
21
    /**
22
     * @var int
23
     */
24
    public $code;
25
26
    /**
27
     * @var string|\Closure
28
     */
29
    public $handler;
30
31
    /**
32
     * @var array
33
     */
34
    public $names;
35
36
    /**
37
     * @var array
38
     */
39
    public $vars;
40
41
    /**
42
     * @var RouterResponse
43
     */
44
    public $routerResponse;
45
46
    /**
47
     * RouterResponse setUp.
48
     */
49
    public function setUp()
50
    {
51
        $this->handler = 'handler';
52
        $this->code = 200;
53
        $this->names = ['name','name2'];
54
        $this->vars = ['a' => 1, 'b' =>2];
55
        $this->routerResponse = new RouterResponse($this->code, $this->handler, $this->names, $this->vars);
56
    }
57
58
    /**
59
     *
60
     */
61
    public function testGetStatusCode()
62
    {
63
        $this->assertEquals($this->code, $this->routerResponse->getStatusCode());
64
    }
65
66
    /**
67
     *
68
     */
69
    public function testGetHandler()
70
    {
71
        $this->assertEquals($this->handler, $this->routerResponse->getHandler());
72
    }
73
74
    /**
75
     *
76
     */
77
    public function testGetVars()
78
    {
79
        $this->assertEquals($this->vars, $this->routerResponse->getVars());
80
    }
81
82
    /**
83
     *
84
     */
85
    public function testGetNames()
86
    {
87
        $this->assertEquals($this->names, $this->routerResponse->getNames());
88
    }
89
}
90