Passed
Push — master ( 05909f...99f62c )
by Alex
08:00
created

NonAsciiCharsUnitTestClass   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
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 27
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testCallNonAsciiCharRoute() 0 11 1
A actionRoute() 0 3 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 NonAsciiCharsUnitTestClass extends BaseRouterUnitTestClass
10
{
11
12
    /**
13
     * Some action
14
     *
15
     * @return int
16
     */
17
    public function actionRoute(): int
18
    {
19
        return 1;
20
    }
21
22
    /**
23
     * Testing callig non-ASCII char route
24
     */
25
    public function testCallNonAsciiCharRoute(): void
26
    {
27
        // setup
28
        $router = $this->getRouter();
29
        RouterUnitTestUtils::setRequestMethod('GET');
30
31
        // test body
32
        $router->addGetRoute('кириллический-урл', $this, 'actionRoute');
33
34
        // assertions
35
        $this->assertEquals(1, $router->callRoute(urlencode('кириллический-урл')));
36
    }
37
38
/**
39
 * Testing getting non-ASCII char route
40
 */
41
    // public function testGetNonAsciiCharRoute(): void
42
    // {
43
    // setup
44
    // test body
45
    // assertions
46
    // }
47
}
48