Skip to content

Commit

Permalink
add test to prove #2723
Browse files Browse the repository at this point in the history
  • Loading branch information
ceeram committed Mar 28, 2012
1 parent 47558e8 commit 7df6477
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lib/Cake/Test/Case/View/Helper/FormHelperTest.php
Expand Up @@ -6575,7 +6575,12 @@ public function testCreateCustomRoute() {
*/
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(
Expand All @@ -6591,6 +6596,13 @@ public function testCreateWithInputDefaults() {
'/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);
}

/**
Expand Down

0 comments on commit 7df6477

Please sign in to comment.