@@ 19-30 (lines=12) @@ | ||
16 | */ |
|
17 | class HasModulesRoutesTraitTest extends AbstractTest |
|
18 | { |
|
19 | public function test_generateGenericModuleDefaultRoutes_no_namespace() |
|
20 | { |
|
21 | $collection = new RouteCollection(); |
|
22 | RouteFactory::generateGenericModuleDefaultRoutes($collection, "admin", '/admin'); |
|
23 | ||
24 | self::assertCount(4, $collection); |
|
25 | ||
26 | self::assertInstanceOf(LiteralRoute::class, $collection->get('admin.slash')); |
|
27 | self::assertInstanceOf(LiteralRoute::class, $collection->get('admin')); |
|
28 | self::assertInstanceOf(StandardRoute::class, $collection->get('admin.default')); |
|
29 | self::assertInstanceOf(StandardRoute::class, $collection->get('admin.default.index')); |
|
30 | } |
|
31 | ||
32 | public function test_generateGenericModuleDefaultRoutes_with_namespace() |
|
33 | { |
|
@@ 32-44 (lines=13) @@ | ||
29 | self::assertInstanceOf(StandardRoute::class, $collection->get('admin.default.index')); |
|
30 | } |
|
31 | ||
32 | public function test_generateGenericModuleDefaultRoutes_with_namespace() |
|
33 | { |
|
34 | $collection = new RouteCollection(); |
|
35 | RouteFactory::generateGenericModuleDefaultRoutes($collection, |
|
36 | ["admin", "Nip\Router\Tests\Fixtures\Application\\"], '/admin'); |
|
37 | ||
38 | self::assertCount(4, $collection); |
|
39 | ||
40 | self::assertInstanceOf(AdminLiteralRoute::class, $collection->get('admin.slash')); |
|
41 | self::assertInstanceOf(AdminLiteralRoute::class, $collection->get('admin')); |
|
42 | self::assertInstanceOf(AdminStandardRoute::class, $collection->get('admin.default')); |
|
43 | self::assertInstanceOf(AdminStandardRoute::class, $collection->get('admin.default.index')); |
|
44 | } |
|
45 | ||
46 | public function test_generateGenericModuleDefaultRoutes_with_namespace_missing_classes() |
|
47 | { |
|
@@ 46-58 (lines=13) @@ | ||
43 | self::assertInstanceOf(AdminStandardRoute::class, $collection->get('admin.default.index')); |
|
44 | } |
|
45 | ||
46 | public function test_generateGenericModuleDefaultRoutes_with_namespace_missing_classes() |
|
47 | { |
|
48 | $collection = new RouteCollection(); |
|
49 | RouteFactory::generateGenericModuleDefaultRoutes($collection, |
|
50 | ["frontend", "Nip\Router\Tests\Fixtures\Application\\"], '/admin'); |
|
51 | ||
52 | self::assertCount(4, $collection); |
|
53 | ||
54 | self::assertInstanceOf(LiteralRoute::class, $collection->get('frontend.slash')); |
|
55 | self::assertInstanceOf(LiteralRoute::class, $collection->get('frontend')); |
|
56 | self::assertInstanceOf(StandardRoute::class, $collection->get('frontend.default')); |
|
57 | self::assertInstanceOf(StandardRoute::class, $collection->get('frontend.default.index')); |
|
58 | } |
|
59 | } |
|
60 |