Permalink
Browse files

Fixing notice errors in Router.

Updating AuthComponent tests for changes in Router behavior.
  • Loading branch information...
markstory committed Jul 18, 2011
1 parent be98e0b commit 16073b4e44e17d8596f16c6998f20677558810d9
Showing with 7 additions and 4 deletions.
  1. +2 −2 lib/Cake/Routing/Router.php
  2. +5 −2 lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php
@@ -921,8 +921,8 @@ public static function reverse($params, $full = false) {
} else {
$url = $params['url'];
}
- $pass = $params['pass'];
- $named = $params['named'];
+ $pass = isset($params['pass']) ? $params['pass'] : array();
+ $named = isset($params['named']) ? $params['named'] : array();
unset(
$params['pass'], $params['named'], $params['paging'], $params['models'], $params['url'], $url['url'],
@@ -292,12 +292,12 @@ public function redirect($url, $status = null, $exit = true) {
}
/**
-* AuthTest class
+* AuthComponentTest class
*
* @package cake
* @package cake.tests.cases.libs.controller.components
*/
-class AuthTest extends CakeTestCase {
+class AuthComponentTest extends CakeTestCase {
/**
* name property
@@ -351,6 +351,7 @@ public function setUp() {
$this->initialized = true;
Router::reload();
+ Router::connect('/:controller/:action/*');
$User = ClassRegistry::init('AuthUser');
$User->updateAll(array('password' => $User->getDataSource()->value(Security::hash('cake', null, true))));
@@ -925,6 +926,7 @@ public function testAdminRoute() {
$prefixes = Configure::read('Routing.prefixes');
Configure::write('Routing.prefixes', array('admin'));
Router::reload();
+ require CAKE . 'Config' . DS . 'routes.php';
$url = '/admin/auth_test/add';
$this->Auth->request->addParams(Router::parse($url));
@@ -977,6 +979,7 @@ public function testLoginActionRedirect() {
$admin = Configure::read('Routing.prefixes');
Configure::write('Routing.prefixes', array('admin'));
Router::reload();
+ require CAKE . 'Config' . DS . 'routes.php';
$url = '/admin/auth_test/login';
$this->Auth->request->addParams(Router::parse($url));

0 comments on commit 16073b4

Please sign in to comment.