Permalink
Browse files

Unskip and update tests for checkbox with default.

  • Loading branch information...
1 parent 5d1df7e commit 5aea92428224d711dc5431ccfd7a4264b3420787 @markstory markstory committed with markstory Feb 20, 2014
Showing with 25 additions and 25 deletions.
  1. +25 −25 tests/TestCase/View/Helper/FormHelperTest.php
View
50 tests/TestCase/View/Helper/FormHelperTest.php
@@ -4002,31 +4002,6 @@ public function testTextDefaultValue() {
}
/**
- * testCheckboxDefaultValue method
- *
- * Test default value setting on checkbox() method
- *
- * @return void
- */
- public function testCheckboxDefaultValue() {
- $this->Form->request->data['Model']['field'] = false;
- $result = $this->Form->checkbox('Model.field', array('default' => true, 'hiddenField' => false));
- $this->assertTags($result, array('input' => array('type' => 'checkbox', 'name' => 'Model[field]', 'value' => '1')));
-
- unset($this->Form->request->data['Model']['field']);
- $result = $this->Form->checkbox('Model.field', array('default' => true, 'hiddenField' => false));
- $this->assertTags($result, array('input' => array('type' => 'checkbox', 'name' => 'Model[field]', 'value' => '1', 'checked' => 'checked')));
-
- $this->Form->request->data['Model']['field'] = true;
- $result = $this->Form->checkbox('Model.field', array('default' => false, 'hiddenField' => false));
- $this->assertTags($result, array('input' => array('type' => 'checkbox', 'name' => 'Model[field]', 'value' => '1', 'checked' => 'checked')));
-
- unset($this->Form->request->data['Model']['field']);
- $result = $this->Form->checkbox('Model.field', array('default' => false, 'hiddenField' => false));
- $this->assertTags($result, array('input' => array('type' => 'checkbox', 'name' => 'Model[field]', 'value' => '1')));
- }
-
-/**
* testError method
*
* Test field error generation
@@ -5052,6 +5027,31 @@ public function testCheckbox() {
}
/**
+ * testCheckboxDefaultValue method
+ *
+ * Test default value setting on checkbox() method
+ *
+ * @return void
+ */
+ public function testCheckboxDefaultValue() {
+ $this->Form->request->data['Model']['field'] = false;
+ $result = $this->Form->checkbox('Model.field', array('default' => true, 'hiddenField' => false));
+ $this->assertTags($result, array('input' => array('type' => 'checkbox', 'name' => 'Model[field]', 'value' => '1')));
+
+ unset($this->Form->request->data['Model']['field']);
+ $result = $this->Form->checkbox('Model.field', array('default' => true, 'hiddenField' => false));
+ $this->assertTags($result, array('input' => array('type' => 'checkbox', 'name' => 'Model[field]', 'value' => '1', 'checked' => 'checked')));
+
+ $this->Form->request->data['Model']['field'] = true;
+ $result = $this->Form->checkbox('Model.field', array('default' => false, 'hiddenField' => false));
+ $this->assertTags($result, array('input' => array('type' => 'checkbox', 'name' => 'Model[field]', 'value' => '1', 'checked' => 'checked')));
+
+ unset($this->Form->request->data['Model']['field']);
+ $result = $this->Form->checkbox('Model.field', array('default' => false, 'hiddenField' => false));
+ $this->assertTags($result, array('input' => array('type' => 'checkbox', 'name' => 'Model[field]', 'value' => '1')));
+ }
+
+/**
* Test checkbox being checked or having errors.
*
* @return void

0 comments on commit 5aea924

Please sign in to comment.