Completed
Pull Request — dev (#11)
by
unknown
04:51
created

testHttpResponseCode()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
c 2
b 1
f 0
dl 0
loc 8
rs 9.4285
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
3
namespace Vectorface\SnappyRouterTests;
4
5
use \PHPUnit_Framework_TestCase;
6
use Vectorface\SnappyRouter\Di\Di;
7
8
class PhpFivePointThreeCompatTest extends PHPUnit_Framework_TestCase
9
{
10
    public function testHttpResponseCode()
11
    {
12
        $currentDi = Di::getDefault();
13
        // ensure we have a clean DI component
14
        Di::setDefault(new Di());
15
        $this->assertEquals(200, \Vectorface\SnappyRouter\http_response_code());
16
        Di::setDefault($currentDi);
17
    }
18
19
    /**
20
     * Tests that an invalid status code throws an exception.
21
     * @expectedException \Exception
22
     * @expectedExceptionMessage Invalid response code: 9999
23
     */
24
    public function testInvalidStatusCodeThrowsException()
25
    {
26
        \Vectorface\SnappyRouter\http_response_code(9999);
27
    }
28
}
29