Passed
Pull Request — main (#11)
by Chema
02:44
created

ErrorHandlingTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 9
dl 0
loc 17
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A test_not_redirect_non_registered_method() 0 15 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GacelaTest\Feature\Router;
6
7
use Gacela\Router\Entities\Request;
8
use Gacela\Router\Router;
9
use GacelaTest\Feature\HeaderTestCase;
10
11
final class ErrorHandlingTest extends HeaderTestCase
12
{
13
    public function test_not_redirect_non_registered_method(): void
14
    {
15
        $_SERVER['REQUEST_URI'] = 'https://example.org/optional/uri';
16
        $_SERVER['REQUEST_METHOD'] = Request::METHOD_OPTIONS;
17
18
        Router::configure(static function (): void {
19
        });
20
21
        self::assertSame([
22
            [
23
                'header' => 'HTTP/1.0 404 Not Found',
24
                'replace' => true,
25
                'response_code' => 0,
26
            ],
27
        ], $this->headers());
28
    }
29
}
30