Code Duplication    Length = 9-9 lines in 3 locations

lib/Cake/Test/Case/View/Helper/FormHelperTest.php 3 locations

@@ 895-903 (lines=9) @@
892
 *
893
 * @return void
894
 */
895
	public function testSecurityButtonNestedNamed() {
896
		$key = 'testKey';
897
		$this->Form->request['_Token'] = array('key' => $key);
898
899
		$this->Form->create('Addresses');
900
		$this->Form->button('Test', array('type' => 'submit', 'name' => 'Address[button]'));
901
		$result = $this->Form->unlockField();
902
		$this->assertEquals(array('Address.button'), $result);
903
	}
904
905
/**
906
 * Test that submit inputs created with foo[bar] name attributes are unlocked correctly.
@@ 910-918 (lines=9) @@
907
 *
908
 * @return void
909
 */
910
	public function testSecuritySubmitNestedNamed() {
911
		$key = 'testKey';
912
		$this->Form->request['_Token'] = array('key' => $key);
913
914
		$this->Form->create('Addresses');
915
		$this->Form->submit('Test', array('type' => 'submit', 'name' => 'Address[button]'));
916
		$result = $this->Form->unlockField();
917
		$this->assertEquals(array('Address.button'), $result);
918
	}
919
920
/**
921
 * Test that the correct fields are unlocked for image submits with no names.
@@ 1314-1322 (lines=9) @@
1311
 *
1312
 * @return void
1313
 */
1314
	public function testFormSecuredRadio() {
1315
		$this->Form->request['_Token'] = array('key' => 'testKey');
1316
		$this->assertEquals(array(), $this->Form->fields);
1317
		$options = array('1' => 'option1', '2' => 'option2');
1318
1319
		$this->Form->radio('Test.test', $options);
1320
		$expected = array('Test.test');
1321
		$this->assertEquals($expected, $this->Form->fields);
1322
	}
1323
1324
/**
1325
 * Test that when disabled is in a list based attribute array it works.