Passed
Push — master ( a4ddd3...82bd79 )
by Alex
06:44
created

UnexistingRouteTestClass   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 1
eloc 8
c 1
b 1
f 0
dl 0
loc 20
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testUnexistingRouteException() 0 14 1
1
<?php
2
declare(strict_types = 1);
3
namespace Mezon\Router\Tests\Base;
4
5
/**
6
 *
7
 * @psalm-suppress PropertyNotSetInConstructor
8
 */
9
abstract class UnexistingRouteTestClass extends BaseRouterUnitTestClass
10
{
11
12
    /**
13
     * Testing default unexisting route handler
14
     */
15
    public function testUnexistingRouteException(): void
16
    {
17
        // setup
18
        $router = $this->getRouter();
19
        $router->addGetRoute('r1', $this, 'r1');
20
        $router->addPostRoute('r1', $this, 'r1');
21
22
        // assertions
23
        $this->expectException(\Exception::class);
24
        $this->expectExceptionCode(- 1);
25
        $this->expectErrorMessage('The processor was not found for the route unexisting in GET : r1, ; POST : r1, ; PUT : <none>; DELETE : <none>; OPTION : <none>; PATCH : <none>');
26
27
        // test body
28
        $router->callRoute('unexisting');
29
    }
30
}
31