Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yeray Santana Hualde
syncEnrollments
Commits
5a37473e
Commit
5a37473e
authored
Jan 27, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added basic bundle routing test.
parent
6b1b0ee5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
1 deletion
+47
-1
routing.test.php
tests/cases/laravel/routing.test.php
+10
-0
bundles.php
tests/laravel/bundles/bundles.php
+34
-1
routes.php
tests/laravel/bundles/dashboard/routes.php
+3
-0
No files found.
tests/cases/laravel/routing.test.php
View file @
5a37473e
...
...
@@ -84,4 +84,14 @@ class RoutingTest extends PHPUnit_Framework_TestCase {
$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
tests/laravel/bundles/bundles.php
View file @
5a37473e
<?php
/*
|--------------------------------------------------------------------------
| Bundle Configuration
|--------------------------------------------------------------------------
|
| Bundles allow you to conveniently extend and organize your application.
| Think of bundles as self-contained applications. They can have routes,
| controllers, models, views, configuration, etc. You can even create
| your own bundles to share with the Laravel community.
|
| This is a list of the bundles installed for your application and tells
| Laravel the location of the bundle's root directory, as well as the
| root URI the bundle responds to.
|
| For example, if you have an "admin" bundle located in "bundles/admin"
| that you want to handle requests with URIs that begin with "admin",
| simply add it to the array like this:
|
| 'admin' => 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
tests/laravel/bundles/dashboard/routes.php
0 → 100644
View file @
5a37473e
<?php
Router
::
register
(
'GET /dashboard'
,
function
()
{});
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment