Skip to content

Commit

Permalink
Test for current full url with a base path.
Browse files Browse the repository at this point in the history
  • Loading branch information
Casmo committed May 30, 2015
1 parent 7397ba3 commit 10eb155
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/TestCase/Routing/RouterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,29 @@ public function testBaseUrlWithBasePath()
$this->assertEquals('http://example.com/cakephp/tasks', Router::url('/tasks', true));
}

/**
* Test that Router used the correct url including base path for requesting current actions.
*
* @return void
*/
public function testCurrentUrlWithBasePath()
{
Router::fullBaseUrl('http://example.com');
$request = new Request();
$request->addParams([
'action' => 'view',
'plugin' => null,
'controller' => 'pages',
'pass' => ['1']
]);
$request->base = '/cakephp';
$request->here = '/cakephp/pages/view/1';
Router::setRequestInfo($request);
$this->assertEquals('http://example.com/cakephp/pages/view/1', Router::url(null, true));
$this->assertEquals('/cakephp/pages/view/1', Router::url());

}

/**
* testRouteDefaultParams method
*
Expand Down

0 comments on commit 10eb155

Please sign in to comment.