diff --git a/cake/tests/cases/libs/view/helper.test.php b/cake/tests/cases/libs/view/helper.test.php index 8cc1b811b54..e380650b99a 100644 --- a/cake/tests/cases/libs/view/helper.test.php +++ b/cake/tests/cases/libs/view/helper.test.php @@ -383,6 +383,12 @@ function testUrlConversion() { 'controller' => 'posts', 'action' => 'index', 'param' => '%7Baround%20here%7D%5Bthings%5D%5Bare%5D%24%24' )); $this->assertEqual($result, "/posts/index/param:%7Baround%20here%7D%5Bthings%5D%5Bare%5D%24%24"); + + $result = $this->Helper->url(array( + 'controller' => 'posts', 'action' => 'index', 'page' => '1', + '?' => array('one' => 'value', 'two' => 'value', 'three' => 'purple') + )); + $this->assertEqual($result, "/posts/index/page:1?one=value&two=value&three=purple"); } /** * testFieldsWithSameName method diff --git a/cake/tests/cases/libs/view/helpers/form.test.php b/cake/tests/cases/libs/view/helpers/form.test.php index a310b1c572c..cb486f6949a 100644 --- a/cake/tests/cases/libs/view/helpers/form.test.php +++ b/cake/tests/cases/libs/view/helpers/form.test.php @@ -4528,6 +4528,32 @@ function testFormCreate() { ); $this->assertTags($result, $expected); } +/** + * Test base form url when url param is passed with multiple parameters (&) + * + */ + function testFormCreateQuerystringParams() { + $result = $this->Form->create('Contact', array( + 'type' => 'post', + 'escape' => false, + 'url' => array( + 'controller' => 'controller', + 'action' => 'action', + '?' => array('param1' => 'value1', 'param2' => 'value2') + ) + )); + $expected = array( + 'form' => array( + 'id' => 'ContactAddForm', + 'method' => 'post', + 'action' => '/controller/action/?param1=value1&param2=value2' + ), + 'fieldset' => array('style' => 'preg:/display\s*\:\s*none;\s*/'), + 'input' => array('type' => 'hidden', 'name' => '_method', 'value' => 'POST'), + '/fieldset' + ); + $this->assertTags($result, $expected, true); + } /** * testGetFormCreate method *