mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Applying fix from ticket #2485, adding test for it
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4894 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
da0dacb013
commit
efd8df1771
2 changed files with 4 additions and 1 deletions
|
@ -159,7 +159,7 @@ class FormHelper extends AppHelper {
|
|||
'action' => $options['action'],
|
||||
'id' => $id
|
||||
);
|
||||
if(!empty($options['action'])) {
|
||||
if(!empty($options['action']) && !isset($options['id'])) {
|
||||
$options['id'] = $model . Inflector::camelize($options['action']) . 'Form';
|
||||
}
|
||||
$options['action'] = am($actionDefaults, (array)$options['url']);
|
||||
|
|
|
@ -632,6 +632,9 @@ class FormHelperTest extends CakeTestCase {
|
|||
$this->assertPattern('/^<form[^<>]+id="ContactEditForm"[^<>]+>/', $result);
|
||||
$this->assertPattern('/^<form[^<>]+action="\/contacts\/edit\/1"[^<>]*>/', $result);
|
||||
$this->assertNoPattern('/^<form[^<>]+[^id|method|action]=[^<>]*>/', $result);
|
||||
|
||||
$result = $this->Form->create('Contact', array('id' => 'TestId'));
|
||||
$this->assertPattern('/id="TestId"/', $result);
|
||||
}
|
||||
|
||||
function testFormEnd() {
|
||||
|
|
Loading…
Reference in a new issue