Skip to content

Commit

Permalink
Fix failing tests and issue where / would be incorrectly handled.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Jun 27, 2014
1 parent b55ccd5 commit 5e72b75
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 22 deletions.
20 changes: 1 addition & 19 deletions src/Routing/Router.php
Expand Up @@ -18,7 +18,6 @@
use Cake\Core\Configure;
use Cake\Error;
use Cake\Network\Request;
use Cake\Routing\RouteCollection;
use Cake\Routing\ScopedRouteCollection;
use Cake\Routing\Route\Route;
use Cake\Utility\Inflector;
Expand All @@ -38,13 +37,6 @@
*/
class Router {

/**
* RouteCollection object containing all the connected routes.
*
* @var \Cake\Routing\RouteCollection
*/
protected static $_routes;

/**
* Have routes been loaded
*
Expand Down Expand Up @@ -485,7 +477,7 @@ public static function parse($url) {
if (!static::$initialized) {
static::_loadRoutes();
}
if (strlen($url) && strpos($url, '/') !== 0) {
if (strpos($url, '/') !== 0) {
$url = '/' . $url;
}

Expand All @@ -499,16 +491,6 @@ public static function parse($url) {
throw new Error\Exception('No routes match the given URL.');
}

/**
* Set the route collection object Router should use.
*
* @param \Cake\Routing\RouteCollection $routes Routes collection.
* @return void
*/
public static function setRouteCollection(RouteCollection $routes) {
static::$_routes = $routes;
}

/**
* Takes parameter and path information back from the Dispatcher, sets these
* parameters as the current request parameters that are merged with URL arrays
Expand Down
3 changes: 1 addition & 2 deletions tests/TestCase/Routing/Filter/CacheFilterTest.php
Expand Up @@ -12,7 +12,7 @@
* @since 3.0.0
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Test\TestCase\Routing;
namespace Cake\Test\TestCase\Routing\Filter;

use Cake\Cache\Cache;
use Cake\Core\Configure;
Expand Down Expand Up @@ -81,7 +81,6 @@ public function testFullPageCachingDispatch($url) {
Configure::write('Cache.check', true);
Configure::write('debug', true);

Router::reload();
Router::connect('/', array('controller' => 'TestCachedPages', 'action' => 'index'));
Router::connect('/test_cached_pages/:action/*', ['controller' => 'TestCachedPages']);

Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Routing/Filter/RoutingFilterTest.php
Expand Up @@ -12,7 +12,7 @@
* @since 3.0.0
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Test\TestCase\Routing;
namespace Cake\Test\TestCase\Routing\Filter;

use Cake\Event\Event;
use Cake\Network\Request;
Expand Down

0 comments on commit 5e72b75

Please sign in to comment.