|
@@ 32-41 (lines=10) @@
|
| 29 |
|
self::assertSame(["controller" => "index", "action" => "index"], $firstRoute->getDefaults()); |
| 30 |
|
} |
| 31 |
|
|
| 32 |
|
public function test_generateIndexRoute_existingClass() |
| 33 |
|
{ |
| 34 |
|
$collection = new RouteCollection(); |
| 35 |
|
RouteFactory::generateIndexRoute($collection, 'index', FixturesLiteralRoute::class); |
| 36 |
|
|
| 37 |
|
self::assertCount(2, $collection); |
| 38 |
|
|
| 39 |
|
$firstRoute = $collection->get('index'); |
| 40 |
|
self::assertInstanceOf(FixturesLiteralRoute::class, $firstRoute); |
| 41 |
|
} |
| 42 |
|
|
| 43 |
|
public function test_generateIndexRoute_nonClass() |
| 44 |
|
{ |
|
@@ 43-52 (lines=10) @@
|
| 40 |
|
self::assertInstanceOf(FixturesLiteralRoute::class, $firstRoute); |
| 41 |
|
} |
| 42 |
|
|
| 43 |
|
public function test_generateIndexRoute_nonClass() |
| 44 |
|
{ |
| 45 |
|
$collection = new RouteCollection(); |
| 46 |
|
RouteFactory::generateIndexRoute($collection, 'index', 'MyApplication\Module\Route\LiteralRoute'); |
| 47 |
|
|
| 48 |
|
self::assertCount(2, $collection); |
| 49 |
|
|
| 50 |
|
$firstRoute = $collection->get('index'); |
| 51 |
|
self::assertInstanceOf(LiteralRoute::class, $firstRoute); |
| 52 |
|
} |
| 53 |
|
|
| 54 |
|
|
| 55 |
|
public function test_generateStandardRoute_emptyClass() |
|
@@ 68-77 (lines=10) @@
|
| 65 |
|
self::assertSame(["action" => "index"], $firstRoute->getDefaults()); |
| 66 |
|
} |
| 67 |
|
|
| 68 |
|
public function test_generateStandardRoute_existingClass() |
| 69 |
|
{ |
| 70 |
|
$collection = new RouteCollection(); |
| 71 |
|
RouteFactory::generateStandardRoute($collection, 'index', FixturesStandardRoute::class); |
| 72 |
|
|
| 73 |
|
self::assertCount(2, $collection); |
| 74 |
|
|
| 75 |
|
$firstRoute = $collection->get('index'); |
| 76 |
|
self::assertInstanceOf(FixturesStandardRoute::class, $firstRoute); |
| 77 |
|
} |
| 78 |
|
|
| 79 |
|
public function test_generateStandardRoute_nonClass() |
| 80 |
|
{ |
|
@@ 79-88 (lines=10) @@
|
| 76 |
|
self::assertInstanceOf(FixturesStandardRoute::class, $firstRoute); |
| 77 |
|
} |
| 78 |
|
|
| 79 |
|
public function test_generateStandardRoute_nonClass() |
| 80 |
|
{ |
| 81 |
|
$collection = new RouteCollection(); |
| 82 |
|
RouteFactory::generateStandardRoute($collection, 'index', 'MyApplication\Module\Route\StandardRoute'); |
| 83 |
|
|
| 84 |
|
self::assertCount(2, $collection); |
| 85 |
|
|
| 86 |
|
$firstRoute = $collection->get('index'); |
| 87 |
|
self::assertInstanceOf(StandardRoute::class, $firstRoute); |
| 88 |
|
} |
| 89 |
|
} |
| 90 |
|
|