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
f93532d2
Commit
f93532d2
authored
Jan 27, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added test for route::is method.
parent
b9f6d162
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
2 deletions
+17
-2
route.test.php
tests/cases/laravel/route.test.php
+17
-2
No files found.
tests/cases/laravel/route.test.php
View file @
f93532d2
<?php
<?php
use
Laravel\Routing\Route
;
class
RouteTest
extends
PHPUnit_Framework_TestCase
{
class
RouteTest
extends
PHPUnit_Framework_TestCase
{
/**
/**
...
@@ -17,7 +19,7 @@ class RouteTest extends PHPUnit_Framework_TestCase {
...
@@ -17,7 +19,7 @@ class RouteTest extends PHPUnit_Framework_TestCase {
*/
*/
public
function
testHandlesIndicatesIfTheRouteHandlesAGivenURI
()
public
function
testHandlesIndicatesIfTheRouteHandlesAGivenURI
()
{
{
$route
=
new
Laravel\Routing\
Route
(
'GET /'
,
array
(
'handles'
=>
array
(
'GET /foo/bar'
)));
$route
=
new
Route
(
'GET /'
,
array
(
'handles'
=>
array
(
'GET /foo/bar'
)));
$this
->
assertTrue
(
$route
->
handles
(
'foo/*'
));
$this
->
assertTrue
(
$route
->
handles
(
'foo/*'
));
$this
->
assertTrue
(
$route
->
handles
(
'foo/bar'
));
$this
->
assertTrue
(
$route
->
handles
(
'foo/bar'
));
...
@@ -26,11 +28,24 @@ class RouteTest extends PHPUnit_Framework_TestCase {
...
@@ -26,11 +28,24 @@ class RouteTest extends PHPUnit_Framework_TestCase {
$this
->
assertFalse
(
$route
->
handles
(
'/foo'
));
$this
->
assertFalse
(
$route
->
handles
(
'/foo'
));
$this
->
assertFalse
(
$route
->
handles
(
'foo'
));
$this
->
assertFalse
(
$route
->
handles
(
'foo'
));
$route
=
new
Laravel\Routing\
Route
(
'GET /'
,
array
(
'handles'
=>
array
(
'GET /'
,
'GET /home'
)));
$route
=
new
Route
(
'GET /'
,
array
(
'handles'
=>
array
(
'GET /'
,
'GET /home'
)));
$this
->
assertTrue
(
$route
->
handles
(
'/'
));
$this
->
assertTrue
(
$route
->
handles
(
'/'
));
$this
->
assertTrue
(
$route
->
handles
(
'home'
));
$this
->
assertTrue
(
$route
->
handles
(
'home'
));
$this
->
assertFalse
(
$route
->
handles
(
'foo'
));
$this
->
assertFalse
(
$route
->
handles
(
'foo'
));
}
}
/**
* Tests the Route::is method.
*
* @group laravel
*/
public
function
testIsMethodIndicatesIfTheRouteHasAGivenName
()
{
$route
=
new
Route
(
'GET /'
,
array
(
'name'
=>
'profile'
));
$this
->
assertTrue
(
$route
->
is
(
'profile'
));
$this
->
assertFalse
(
$route
->
is
(
'something'
));
}
}
}
\ 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