mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Added tests to test ajax settings
This commit is contained in:
parent
9587892727
commit
3c8c2936b3
1 changed files with 31 additions and 0 deletions
|
@ -6073,6 +6073,37 @@ class FormHelperTest extends CakeTestCase {
|
|||
'/div'
|
||||
);
|
||||
$this->assertTags($result, $expected);
|
||||
|
||||
$this->Form->request->data = array();
|
||||
$this->Form->request['controller'] = 'contacts';
|
||||
$this->Form->request['models'] = array('Contact' => array('plugin' => null, 'className' => 'Contact'));
|
||||
$result = $this->Form->create(array('url' => array('action' => 'index', 'param'), 'default' => false));
|
||||
$expected = array(
|
||||
'form' => array(
|
||||
'id' => 'ContactAddForm', 'method' => 'post', 'onsubmit' => 'event.returnValue = false; return false;', 'action' => '/contacts/index/param',
|
||||
'accept-charset' => 'utf-8'
|
||||
),
|
||||
'div' => array('style' => 'display:none;'),
|
||||
'input' => array('type' => 'hidden', 'name' => '_method', 'value' => 'POST'),
|
||||
'/div'
|
||||
);
|
||||
$this->assertTags($result, $expected);
|
||||
|
||||
$this->Form->request->data = array();
|
||||
$this->Form->request['controller'] = 'contacts';
|
||||
$this->Form->request['models'] = array('Contact' => array('plugin' => null, 'className' => 'Contact'));
|
||||
$result = $this->Form->create(array('url' => array('action' => 'index', 'param'), 'default' => false, 'onsubmit' => 'someFunction();'));
|
||||
|
||||
$expected = array(
|
||||
'form' => array(
|
||||
'id' => 'ContactAddForm', 'method' => 'post', 'onsubmit' => 'someFunction(); event.returnValue = false; return false;', 'action' => '/contacts/index/param',
|
||||
'accept-charset' => 'utf-8'
|
||||
),
|
||||
'div' => array('style' => 'display:none;'),
|
||||
'input' => array('type' => 'hidden', 'name' => '_method', 'value' => 'POST'),
|
||||
'/div'
|
||||
);
|
||||
$this->assertTags($result, $expected);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue