Skip to content
This repository
Browse code

add test to prove #2723

  • Loading branch information...
commit 7df6477526d15861cfa23e085f6ffb19cfa79cc2 1 parent 47558e8
ceeram authored March 28, 2012
14  lib/Cake/Test/Case/View/Helper/FormHelperTest.php
@@ -6575,7 +6575,12 @@ public function testCreateCustomRoute() {
6575 6575
  */
6576 6576
 	public function testCreateWithInputDefaults() {
6577 6577
 		$this->Form->create('User', array(
6578  
-			'inputDefaults' => array('div' => false, 'label' => false)
  6578
+			'inputDefaults' => array(
  6579
+				'div' => false,
  6580
+				'label' => false,
  6581
+				'error' => array('attributes' => array('wrap' => 'small', 'class' => 'error')),
  6582
+				'format' => array('before', 'label', 'between', 'input', 'after', 'error')
  6583
+			)
6579 6584
 		));
6580 6585
 		$result = $this->Form->input('username');
6581 6586
 		$expected = array(
@@ -6591,6 +6596,13 @@ public function testCreateWithInputDefaults() {
6591 6596
 			'/div'
6592 6597
 		);
6593 6598
 		$this->assertTags($result, $expected);
  6599
+
  6600
+		$result = $this->Form->input('username', array('label' => 'Username', 'format' => array('input', 'label')));
  6601
+		$expected = array(
  6602
+			'input' => array('type' => 'text', 'name' => 'data[User][username]', 'id' => 'UserUsername'),
  6603
+			'label' => array('for' => 'UserUsername'), 'Username', '/label',
  6604
+		);
  6605
+		$this->assertTags($result, $expected);
6594 6606
 	}
6595 6607
 
6596 6608
 /**

0 notes on commit 7df6477

Please sign in to comment.
Something went wrong with that request. Please try again.