summaryrefslogtreecommitdiff
path: root/tests/Unit/RouteMatchTest.php
blob: e3b8bce2d1634f3ee5908d48262ab7fdf738e478 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php

declare(strict_types=1);

use Lightscale\Router\Enums\HttpMethod;
use Lightscale\Router\PathSegment;
use Lightscale\Router\PathSegmentMatch;
use Lightscale\Router\Route;
use Lightscale\Router\RouteMatch;

it('initializes with data', function () {
    $v = new RouteMatch(
        $segMatch = new PathSegmentMatch(
            new PathSegment('test'),
            []
        ),
        $route = new Route(
            HttpMethod::Get,
            fn () => null,
        ),
    );

    expect($v)
        ->segmentMatch->toBe($segMatch)
        ->route->toBe($route);
});