Skip to content
This repository
Browse code

add test to show label options in inputDefaults

  • Loading branch information...
commit 8c631fa0224a0572aeb090f2af671d7c2161de1b 1 parent 5c590aa
ceeram authored April 05, 2012
15  lib/Cake/Test/Case/View/Helper/FormHelperTest.php
@@ -6603,6 +6603,21 @@ public function testCreateWithInputDefaults() {
6603 6603
 			'label' => array('for' => 'UserUsername'), 'Username', '/label',
6604 6604
 		);
6605 6605
 		$this->assertTags($result, $expected);
  6606
+
  6607
+		$this->Form->create('User', array(
  6608
+			'inputDefaults' => array(
  6609
+				'div' => false,
  6610
+				'label' => array('class' => 'nice', 'for' => 'changed'),
  6611
+			)
  6612
+		));
  6613
+		$result = $this->Form->input('username', array('div' => true));
  6614
+		$expected = array(
  6615
+			'div' => array('class' => 'input text'),
  6616
+			'label' => array('for' => 'changed', 'class' => 'nice'), 'Username', '/label',
  6617
+			'input' => array('type' => 'text', 'name' => 'data[User][username]', 'id' => 'UserUsername'),
  6618
+			'/div'
  6619
+		);
  6620
+		$this->assertTags($result, $expected);
6606 6621
 	}
6607 6622
 
6608 6623
 /**

0 notes on commit 8c631fa

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