Code Duplication    Length = 23-23 lines in 2 locations

tests/src/Router/Traits/HasGeneratorTraitTest.php 2 locations

@@ 25-47 (lines=23) @@
22
        self::assertInstanceOf(UrlGenerator::class, $router->getGenerator());
23
    }
24
25
    public function testAssemble()
26
    {
27
        $router = new Router();
28
        $collection = $router->getRoutes();
29
30
        RouteFactory::generateLiteralRoute($collection, "admin.index", Route::class, "/admin", "/index");
31
        RouteFactory::generateStandardRoute($collection, "api.index", StandardRoute::class, "/api");
32
33
        self::assertSame(
34
            '/admin/index?controller=posts',
35
            $router->assemble('admin.index', ['controller' => 'posts'])
36
        );
37
38
        self::assertSame(
39
            '/api/posts',
40
            $router->assemble('api.index', ['controller' => 'posts'])
41
        );
42
43
        self::assertSame(
44
            '/api/posts/create?test=true',
45
            $router->assemble('api.index', ['controller' => 'posts', 'action' => 'create', 'test' => 'true'])
46
        );
47
    }
48
49
    public function testGenerate()
50
    {
@@ 49-71 (lines=23) @@
46
        );
47
    }
48
49
    public function testGenerate()
50
    {
51
        $router = new Router();
52
        $collection = $router->getRoutes();
53
54
        RouteFactory::generateLiteralRoute($collection, "admin.index", Route::class, "/admin", "/index");
55
        RouteFactory::generateStandardRoute($collection, "api.index", StandardRoute::class, "/api");
56
57
        self::assertSame(
58
            '/admin/index?controller=posts',
59
            $router->generate('admin.index', ['controller' => 'posts'])
60
        );
61
62
        self::assertSame(
63
            '/api/posts',
64
            $router->generate('api.index', ['controller' => 'posts'])
65
        );
66
67
        self::assertSame(
68
            '/api/posts/create?param=test',
69
            $router->generate('api.index', ['controller' => 'posts','action' => 'create', 'param' => 'test'])
70
        );
71
    }
72
}
73