@@ 19-30 (lines=12) @@ | ||
16 | */ |
|
17 | class HasBaseRoutesTraitTest extends AbstractTest |
|
18 | { |
|
19 | public function test_generateIndexRoute_emptyClass() |
|
20 | { |
|
21 | $collection = new RouteCollection(); |
|
22 | RouteFactory::generateIndexRoute($collection, 'index'); |
|
23 | ||
24 | self::assertCount(2, $collection); |
|
25 | ||
26 | $firstRoute = $collection->get('index'); |
|
27 | self::assertInstanceOf(LiteralRoute::class, $firstRoute); |
|
28 | self::assertSame('/', $firstRoute->getParser()->getMap()); |
|
29 | self::assertSame(["controller" => "index", "action" => "index"], $firstRoute->getDefaults()); |
|
30 | } |
|
31 | ||
32 | public function test_generateIndexRoute_existingClass() |
|
33 | { |
|
@@ 55-66 (lines=12) @@ | ||
52 | } |
|
53 | ||
54 | ||
55 | public function test_generateStandardRoute_emptyClass() |
|
56 | { |
|
57 | $collection = new RouteCollection(); |
|
58 | RouteFactory::generateStandardRoute($collection, 'index'); |
|
59 | ||
60 | self::assertCount(2, $collection); |
|
61 | ||
62 | $firstRoute = $collection->get('index'); |
|
63 | self::assertInstanceOf(StandardRoute::class, $firstRoute); |
|
64 | self::assertSame('/{controller}/{action?index}', $firstRoute->getParser()->getMap()); |
|
65 | self::assertSame(["action" => "index"], $firstRoute->getDefaults()); |
|
66 | } |
|
67 | ||
68 | public function test_generateStandardRoute_existingClass() |
|
69 | { |