mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Merge branch '1.3' of git://github.com/cakephp/cakephp into 1.3
This commit is contained in:
commit
87c659d653
2 changed files with 27 additions and 5 deletions
|
@ -363,10 +363,6 @@ class FormHelper extends AppHelper {
|
||||||
unset($options['label']);
|
unset($options['label']);
|
||||||
}
|
}
|
||||||
$submitOptions = $options;
|
$submitOptions = $options;
|
||||||
|
|
||||||
if (!$submit) {
|
|
||||||
$submit = __('Submit', true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
$out .= $this->submit($submit, $submitOptions);
|
$out .= $this->submit($submit, $submitOptions);
|
||||||
}
|
}
|
||||||
|
@ -1309,7 +1305,7 @@ class FormHelper extends AppHelper {
|
||||||
* @link http://book.cakephp.org/view/1431/submit
|
* @link http://book.cakephp.org/view/1431/submit
|
||||||
*/
|
*/
|
||||||
function submit($caption = null, $options = array()) {
|
function submit($caption = null, $options = array()) {
|
||||||
if (!$caption) {
|
if (!is_string($caption) && empty($caption)) {
|
||||||
$caption = __('Submit', true);
|
$caption = __('Submit', true);
|
||||||
}
|
}
|
||||||
$out = null;
|
$out = null;
|
||||||
|
|
|
@ -5284,6 +5284,14 @@ class FormHelperTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function testSubmitButton() {
|
function testSubmitButton() {
|
||||||
|
$result = $this->Form->submit('');
|
||||||
|
$expected = array(
|
||||||
|
'div' => array('class' => 'submit'),
|
||||||
|
'input' => array('type' => 'submit', 'value' => ''),
|
||||||
|
'/div'
|
||||||
|
);
|
||||||
|
$this->assertTags($result, $expected);
|
||||||
|
|
||||||
$result = $this->Form->submit('Test Submit');
|
$result = $this->Form->submit('Test Submit');
|
||||||
$expected = array(
|
$expected = array(
|
||||||
'div' => array('class' => 'submit'),
|
'div' => array('class' => 'submit'),
|
||||||
|
@ -6333,6 +6341,24 @@ class FormHelperTest extends CakeTestCase {
|
||||||
function testFormEnd() {
|
function testFormEnd() {
|
||||||
$this->assertEqual($this->Form->end(), '</form>');
|
$this->assertEqual($this->Form->end(), '</form>');
|
||||||
|
|
||||||
|
$result = $this->Form->end('');
|
||||||
|
$expected = array(
|
||||||
|
'div' => array('class' => 'submit'),
|
||||||
|
'input' => array('type' => 'submit', 'value' => ''),
|
||||||
|
'/div',
|
||||||
|
'/form'
|
||||||
|
);
|
||||||
|
$this->assertTags($result, $expected);
|
||||||
|
|
||||||
|
$result = $this->Form->end(array('label' => ''));
|
||||||
|
$expected = array(
|
||||||
|
'div' => array('class' => 'submit'),
|
||||||
|
'input' => array('type' => 'submit', 'value' => ''),
|
||||||
|
'/div',
|
||||||
|
'/form'
|
||||||
|
);
|
||||||
|
$this->assertTags($result, $expected);
|
||||||
|
|
||||||
$result = $this->Form->end('save');
|
$result = $this->Form->end('save');
|
||||||
$expected = array(
|
$expected = array(
|
||||||
'div' => array('class' => 'submit'),
|
'div' => array('class' => 'submit'),
|
||||||
|
|
Loading…
Reference in a new issue