diff --git a/tests/cases/laravel/routing.test.php b/tests/cases/laravel/routing.test.php index 1c8ca5e6..a747fe79 100644 --- a/tests/cases/laravel/routing.test.php +++ b/tests/cases/laravel/routing.test.php @@ -84,4 +84,14 @@ public function testBasicRouteToControllerIsRouted() $this->assertEquals('admin.panel@show', Router::route('GET', 'admin/panel/show')->action['uses']); } + /** + * Test basic bundle route resolution. + * + * @group laravel + */ + public function testRoutesToBundlesCanBeResolved() + { + $this->assertEquals('GET /dashboard', Router::route('GET', 'dashboard')->key); + } + } \ No newline at end of file diff --git a/tests/laravel/bundles/bundles.php b/tests/laravel/bundles/bundles.php index cea0ba4d..a3f62b36 100644 --- a/tests/laravel/bundles/bundles.php +++ b/tests/laravel/bundles/bundles.php @@ -1,10 +1,43 @@ array( +| 'location' => 'admin', +| 'handles' => 'admin', +| ), +| +| Note that the "location" is relative to the "bundles" directory. +| Now the bundle will be recognized by Laravel and will be able +| to respond to requests beginning with "admin"! +| +| Have a bundle that lives in the root of the bundle directory +| and doesn't respond to any requests? Just add the bundle +| name to the array and we'll take care of the rest. +| +*/ + return array( 'dashboard' => array( 'location' => 'dashboard', - 'handles' => 'dashboard', + 'handles' => 'dashboard', ), ); \ No newline at end of file diff --git a/tests/laravel/bundles/dashboard/routes.php b/tests/laravel/bundles/dashboard/routes.php new file mode 100644 index 00000000..065fdd79 --- /dev/null +++ b/tests/laravel/bundles/dashboard/routes.php @@ -0,0 +1,3 @@ +