mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 02:26:17 +00:00
Updated dispatcher test for case described in #4660
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6906 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
638b06ff85
commit
926b88a53a
1 changed files with 28 additions and 1 deletions
|
@ -256,6 +256,30 @@ class DispatcherTest extends UnitTestCase {
|
|||
$this->assertPattern('/\\A(?:0000400)\\z/', $test['pass'][5]);
|
||||
}
|
||||
|
||||
function testQueryStringOnRoot() {
|
||||
$_GET = array('coffee' => 'life',
|
||||
'sleep' => 'sissies');
|
||||
$Dispatcher =& new Dispatcher();
|
||||
$uri = 'posts/home/?coffee=life&sleep=sissies';
|
||||
$result = $Dispatcher->parseParams($uri);
|
||||
$this->assertPattern('/posts/',$result['controller']);
|
||||
$this->assertPattern('/home/',$result['action']);
|
||||
$this->assertTrue(isset($result['url']['sleep']));
|
||||
$this->assertTrue(isset($result['url']['coffee']));
|
||||
|
||||
|
||||
$Dispatcher =& new Dispatcher();
|
||||
$uri = '/?coffee=life&sleep=sissy';
|
||||
$result = $Dispatcher->parseParams($uri);
|
||||
$this->assertPattern('/pages/',$result['controller']);
|
||||
$this->assertPattern('/display/',$result['action']);
|
||||
$this->assertTrue(isset($result['url']['sleep']));
|
||||
$this->assertTrue(isset($result['url']['coffee']));
|
||||
$this->assertEqual($result['url']['coffee'], 'life');
|
||||
|
||||
$_GET = $this->_get;
|
||||
}
|
||||
|
||||
function testFileUploadArrayStructure() {
|
||||
$_FILES = array('data' => array('name' => array(
|
||||
'File' => array(
|
||||
|
@ -380,6 +404,7 @@ class DispatcherTest extends UnitTestCase {
|
|||
$result = $Dispatcher->getUrl($uri);
|
||||
$expected = '?/home';
|
||||
$this->assertEqual($expected, $result);
|
||||
|
||||
}
|
||||
|
||||
function testBaseUrlAndWebrootWithModRewrite() {
|
||||
|
@ -881,6 +906,8 @@ class DispatcherTest extends UnitTestCase {
|
|||
$Dispatcher->cached('test_plugin/css/test_plugin_asset.css');
|
||||
$result = ob_get_clean();
|
||||
$this->assertEqual('this is the test plugin asset css file', $result);
|
||||
|
||||
header('Content-type: text/html'); //reset the header content-type without page can render as plain text.
|
||||
}
|
||||
|
||||
function testFullPageCachingDispatch() {
|
||||
|
|
Loading…
Add table
Reference in a new issue