mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
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:
parent
cd7d18de68
commit
0d76bfe325
1 changed files with 19 additions and 0 deletions
|
@ -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()
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue