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

MethodNotAllowedExceptionTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 0
cbo 2
dl 0
loc 20
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A synopsis() 0 13 2
1
<?php
2
3
namespace Vectorface\SnappyRouterTests\Exception;
4
5
use \PHPUnit_Framework_TestCase;
6
use Vectorface\SnappyRouter\Exception\MethodNotAllowedException;
7
8
/**
9
 * Tests the MethodNotAllowedException class.
10
 * @copyright Copyright (c) 2014, VectorFace, Inc.
11
 * @author Dan Bruce <[email protected]>
12
 */
13
class MethodNotAllowedExceptionTest extends PHPUnit_Framework_TestCase
14
{
15
    /**
16
     * An overview of how the class works.
17
     * @test
18
     */
19
    public function synopsis()
20
    {
21
        $exception = new MethodNotAllowedException(
22
            'Cannot use GET',
23
            array('POST')
24
        );
25
        $this->assertEquals(405, $exception->getAssociatedStatusCode());
26
        try {
27
            throw $exception;
28
        } catch (MethodNotAllowedException $e) {
29
            $this->assertEquals('Cannot use GET', $e->getMessage());
30
        }
31
    }
32
}
33