Issues (94)

tests/RouteTest.php (1 issue)

Labels
Severity
1
<?php
2
class RouteTest extends \PHPUnit\Framework\TestCase
3
{
4
    public function testConstruct()
5
    {
6
        $name = 'myRoute';
7
        $method = 'any';
8
        $path = '/test-uri';
9
        $request = new Suricate\Request();
10
        $routeTarget = 'myController::myMethod';
11
        $parametersDefinitions = [];
12
        $middleware = null;
13
14
        $route = new Suricate\Route(
15
            $name,
16
            $method,
17
            $path,
18
            $request,
19
            $routeTarget,
0 ignored issues
show
$routeTarget of type string is incompatible with the type array|null expected by parameter $routeTarget of Suricate\Route::__construct(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

19
            /** @scrutinizer ignore-type */ $routeTarget,
Loading history...
20
            $parametersDefinitions,
21
            $middleware
22
        );
23
24
        $this->assertEquals($path, $route->getPath());
25
        $this->assertEquals(['any'], $route->getMethod());
26
        $this->assertEquals($name, $route->getName());
27
        $this->assertEquals([], $route->getParameters());
28
    }
29
}
30