add test to prove #2723

This commit is contained in:
Ceeram 2012-03-28 22:22:58 +02:00
parent 47558e8db5
commit 7df6477526

View file

@ -6575,7 +6575,12 @@ class FormHelperTest extends CakeTestCase {
*/
public function testCreateWithInputDefaults() {
$this->Form->create('User', array(
'inputDefaults' => array('div' => false, 'label' => false)
'inputDefaults' => array(
'div' => false,
'label' => false,
'error' => array('attributes' => array('wrap' => 'small', 'class' => 'error')),
'format' => array('before', 'label', 'between', 'input', 'after', 'error')
)
));
$result = $this->Form->input('username');
$expected = array(
@ -6591,6 +6596,13 @@ class FormHelperTest extends CakeTestCase {
'/div'
);
$this->assertTags($result, $expected);
$result = $this->Form->input('username', array('label' => 'Username', 'format' => array('input', 'label')));
$expected = array(
'input' => array('type' => 'text', 'name' => 'data[User][username]', 'id' => 'UserUsername'),
'label' => array('for' => 'UserUsername'), 'Username', '/label',
);
$this->assertTags($result, $expected);
}
/**