Skip to content

Commit

Permalink
Add an additional test for CakeRequest::referer().
Browse files Browse the repository at this point in the history
Trying to track down the issue for #3897. This test coverage was
missing, so fix that.
  • Loading branch information
markstory committed Jun 30, 2013
1 parent cd7d18d commit 0d76bfe
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions lib/Cake/Test/Case/Network/CakeRequestTest.php
Expand Up @@ -700,6 +700,25 @@ public function testReferer() {
$this->assertSame($result, 'cakephp.org');
}

/**
* Test referer() with a base path that duplicates the
* first segment.
*
* @return void
*/
public function testRefererBasePath() {
$request = new CakeRequest('some/path');
$request->url = 'users/login';
$request->webroot = '/waves/';
$request->base = '/waves';
$request->here = '/waves/users/login';

$_SERVER['HTTP_REFERER'] = FULL_BASE_URL . '/waves/waves/add';

$result = $request->referer(true);
$this->assertSame($result, '/waves/add');
}

/**
* test the simple uses of is()
*
Expand Down

0 comments on commit 0d76bfe

Please sign in to comment.