Skip to content

Commit

Permalink
Fixing notice errors in Router.
Browse files Browse the repository at this point in the history
Updating AuthComponent tests for changes in Router behavior.
  • Loading branch information
markstory committed Jul 23, 2011
1 parent be98e0b commit 16073b4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/Cake/Routing/Router.php
Expand Up @@ -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'],
Expand Down
7 changes: 5 additions & 2 deletions lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php
Expand Up @@ -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
Expand Down Expand Up @@ -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))));
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit 16073b4

Please sign in to comment.