Add an additional test for CakeRequest::referer().

Trying to track down the issue for #3897. This test coverage was
missing, so fix that.
This commit is contained in:
mark_story 2013-06-29 23:22:33 -04:00
parent cd7d18de68
commit 0d76bfe325

View file

@ -700,6 +700,25 @@ class CakeRequestTest extends CakeTestCase {
$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()
*