Skip to content
Permalink
Browse files

Fix failing tests due to prefixes.

  • Loading branch information...
markstory committed Jul 4, 2012
1 parent ceaf2c5 commit 858a5edcd5015fab1853ecd8a244e193ae61842c
Showing with 7 additions and 7 deletions.
  1. +6 −6 lib/Cake/Test/TestCase/View/Helper/PaginatorHelperTest.php
  2. +1 −1 lib/Cake/View/View.php
@@ -532,9 +532,9 @@ public function testSortDirFallbackToParams() {
public function testSortAdminLinks() {
Configure::write('Routing.prefixes', array('admin'));
Router::reload();
Router::connect('/admin/:controller/:action/*', array('admin' => true, 'prefix' => 'admin'));
Router::connect('/admin/:controller/:action/*', array('prefix' => 'admin'));
Router::setRequestInfo(array(
array('controller' => 'users', 'plugin' => null, 'action' => 'admin_index', 'prefix' => 'admin', 'admin' => true),
array('controller' => 'users', 'plugin' => null, 'action' => 'index', 'prefix' => 'admin'),
array('base' => '', 'here' => '/admin/users', 'webroot' => '/')
));
$this->Paginator->request->params['paging']['Article']['page'] = 1;
@@ -606,7 +606,7 @@ public function testUrlGeneration() {
public function testUrlGenerationWithPrefixes() {
Configure::write('Routing.prefixes', array('members'));
Router::reload();
Router::connect('/members/:controller/:action/*', array('prefix' => 'members', 'members' => true));
Router::connect('/members/:controller/:action/*', array('prefix' => 'members'));
Router::connect('/:controller/:action/*');
Router::setRequestInfo(array(
@@ -617,7 +617,7 @@ public function testUrlGenerationWithPrefixes() {
$this->Paginator->request->params['paging']['Article']['options']['page'] = 2;
$this->Paginator->request->params['paging']['Article']['page'] = 2;
$this->Paginator->request->params['paging']['Article']['prevPage'] = true;
$options = array('members' => true);
$options = array('prefix' => 'members');
$result = $this->Paginator->url($options);
$expected = '/members/posts/index?page=2';
@@ -651,7 +651,7 @@ public function testUrlGenerationWithPrefixes() {
);
$this->assertTags($result, $expected);
$options = array('members' => true, 'controller' => 'posts', 'order' => array('name' => 'desc'));
$options = array('prefix' => 'members', 'controller' => 'posts', 'order' => array('name' => 'desc'));
$result = $this->Paginator->url($options);
$expected = '/members/posts/index?page=2&sort=name&direction=desc';
$this->assertEquals($expected, $result);
@@ -737,7 +737,7 @@ public function testPassedArgsMergingWithUrlOptions() {
$result = $this->Paginator->sort('title');
$expected = array(
'a' => array('href' => '/articles/index/2?page=1&foo=bar&sort=title&direction=asc&x=y'),
'a' => array('href' => '/articles/index/2?page=1&sort=title&direction=asc&foo=bar&x=y'),
'Title',
'/a'
);
@@ -328,7 +328,7 @@ public function __construct(Controller $controller = null) {
$this->_eventManager = $controller->getEventManager();
}
if (empty($this->request) && !($this->request = Router::getRequest(true))) {
$this->request = new Request(null, false);
$this->request = new Request();
$this->request->base = '';
$this->request->here = $this->request->webroot = '/';
}

0 comments on commit 858a5ed

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