mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Added test cases showing usage of 'full_base' key for url generation. Refs #1256
This commit is contained in:
parent
d1403b0da8
commit
81ce6f40b9
2 changed files with 24 additions and 8 deletions
|
@ -74,6 +74,8 @@ class RouterTest extends CakeTestCase {
|
||||||
function testFullBaseURL() {
|
function testFullBaseURL() {
|
||||||
$this->assertPattern('/^http(s)?:\/\//', Router::url('/', true));
|
$this->assertPattern('/^http(s)?:\/\//', Router::url('/', true));
|
||||||
$this->assertPattern('/^http(s)?:\/\//', Router::url(null, true));
|
$this->assertPattern('/^http(s)?:\/\//', Router::url(null, true));
|
||||||
|
$this->assertPattern('/^http(s)?:\/\//', Router::url(array('full_base' => true)));
|
||||||
|
$this->assertIdentical(FULL_BASE_URL . '/', Router::url(array('full_base' => true)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -21,6 +21,10 @@ App::import('Helper', array('Html', 'Paginator', 'Form', 'Ajax', 'Javascript', '
|
||||||
|
|
||||||
Mock::generate('JsHelper', 'PaginatorMockJsHelper');
|
Mock::generate('JsHelper', 'PaginatorMockJsHelper');
|
||||||
|
|
||||||
|
if (!defined('FULL_BASE_URL')) {
|
||||||
|
define('FULL_BASE_URL', 'http://cakephp.org');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PaginatorHelperTest class
|
* PaginatorHelperTest class
|
||||||
*
|
*
|
||||||
|
@ -1718,6 +1722,16 @@ class PaginatorHelperTest extends CakeTestCase {
|
||||||
'/span',
|
'/span',
|
||||||
);
|
);
|
||||||
$this->assertTags($result, $expected);
|
$this->assertTags($result, $expected);
|
||||||
|
|
||||||
|
$this->Paginator->options(array('url' => array('full_base' => true)));
|
||||||
|
$result = $this->Paginator->first();
|
||||||
|
|
||||||
|
$expected = array(
|
||||||
|
'<span',
|
||||||
|
array('a' => array('href' => FULL_BASE_URL . '/index/page:1/sort:Client.name/direction:DESC')), '<< first', '/a',
|
||||||
|
'/span',
|
||||||
|
);
|
||||||
|
$this->assertTags($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue