Commit aa427bbd authored by Taylor Otwell's avatar Taylor Otwell

added route test for handles method. fixed bug in route class.

parent f4e1eaf2
...@@ -79,7 +79,7 @@ class Route { ...@@ -79,7 +79,7 @@ class Route {
*/ */
protected static function extract($segment) protected static function extract($segment)
{ {
$uri = substr($segment, strpos($segment, ' ') + 1); $uri = substr($segment, strpos($segment, ' '));
return ($uri !== '/') ? trim($uri, '/') : $uri; return ($uri !== '/') ? trim($uri, '/') : $uri;
} }
......
<?php
class RouteTest extends PHPUnit_Framework_TestCase {
/**
* Destroy the testing environment.
*/
public function tearDown()
{
Request::$route = null;
}
/**
* Tests the Route::handles method.
*
* @group laravel
*/
public function testHandlesReturnsTrueWhenRouteHandlesTheGivenURI()
{
$route = new Laravel\Routing\Route('GET /', array('handles' => array('foo/bar')));
$this->assertTrue($route->handles('foo/bar'));
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment