Skip to content
Permalink
Browse files

Fixing isset() checks in Router to test for empty values instead.

Updating prefix use in paginator helper test.
  • Loading branch information...
markstory committed Sep 30, 2009
1 parent 17782f7 commit 893e177909cb9d62ed5bc12148b2a2d29e7bf268
Showing with 9 additions and 4 deletions.
  1. +2 −2 cake/libs/router.php
  2. +7 −2 cake/tests/cases/libs/view/helpers/paginator.test.php
@@ -177,10 +177,10 @@ function Router() {
**/
function __setPrefixes() {
$routing = Configure::read('Routing');
if (isset($routing['admin'])) {
if (!empty($routing['admin'])) {
$this->__prefixes[] = $routing['admin'];
}
if (isset($routing['prefixes'])) {
if (!empty($routing['prefixes'])) {
$this->__prefixes = array_merge($this->__prefixes, (array)$routing['prefixes']);
}
}
@@ -449,8 +449,11 @@ function testUrlGeneration() {
* @return void
*/
function testUrlGenerationWithPrefixes() {
$memberPrefixes = array('prefix' => 'members', 'members' => true);
Router::connect('/members/:controller/:action/*', $memberPrefixes);
$_back = Configure::read('Routing');
Configure::write('Routing.prefixes', array('members'));
Router::reload();
Router::parse('/');
Router::setRequestInfo( array(
@@ -500,6 +503,8 @@ function testUrlGenerationWithPrefixes() {
$result = $this->Paginator->url($options);
$expected = '/posts/index/page:2/sort:Article.name/direction:desc';
$this->assertEqual($result, $expected);
Configure::write('Routing', $_back);
}
/**

0 comments on commit 893e177

Please sign in to comment.
You can’t perform that action at this time.