Permalink
Browse files

add test to prove #2723

  • Loading branch information...
1 parent 47558e8 commit 7df6477526d15861cfa23e085f6ffb19cfa79cc2 @ceeram ceeram committed Mar 28, 2012
Showing with 13 additions and 1 deletion.
  1. +13 −1 lib/Cake/Test/Case/View/Helper/FormHelperTest.php
@@ -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(
@@ -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);
}
/**

0 comments on commit 7df6477

Please sign in to comment.