Passed
Branch release/v2.0.0 (caca50)
by Anatoly
02:10
created

MethodNotAllowedExceptionTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 6
c 1
b 0
f 0
dl 0
loc 22
rs 10
1
<?php declare(strict_types=1);
2
3
namespace Sunrise\Http\Router\Tests\Exception;
4
5
/**
6
 * Import classes
7
 */
8
use PHPUnit\Framework\TestCase;
9
use Sunrise\Http\Router\Exception\ExceptionInterface;
10
use Sunrise\Http\Router\Exception\MethodNotAllowedException;
11
use RuntimeException;
12
13
/**
14
 * MethodNotAllowedExceptionTest
15
 */
16
class MethodNotAllowedExceptionTest extends TestCase
17
{
18
19
    /**
20
     * @return void
21
     */
22
    public function testConstructor() : void
23
    {
24
        $exception = new MethodNotAllowedException([]);
25
26
        $this->assertInstanceOf(RuntimeException::class, $exception);
27
        $this->assertInstanceOf(ExceptionInterface::class, $exception);
28
    }
29
30
    /**
31
     * @return void
32
     */
33
    public function testGetAllowedMethods() : void
34
    {
35
        $exception = new MethodNotAllowedException(['foo']);
36
37
        $this->assertSame(['foo'], $exception->getAllowedMethods());
38
    }
39
}
40