Permalink
Browse files

add testSingleCheckboxWithValue()

  • Loading branch information...
1 parent f74ab31 commit 2f7f9a1f6c425c7cacba87e6acc7c3939b153c90 @scribu committed Feb 21, 2013
Showing with 20 additions and 0 deletions.
  1. +20 −0 tests/test-forms.php
View
@@ -104,6 +104,26 @@ function testSingleCheckbox() {
$this->assertEmpty( $el->attr( 'checked' ) );
}
+ function testSingleCheckboxWithValue() {
+ $args = array(
+ 'name' => 'fruit',
+ 'type' => 'checkbox',
+ 'desc' => 'Orange'
+ );
+
+ $output = scbForms::input_with_value( $args, false );
+
+ $el = self::domify( $output )->find('//input[@type="checkbox"]');
+
+ $this->assertEmpty( $el->attr( 'checked' ) );
+
+ $output = scbForms::input_with_value( $args, true );
+
+ $el = self::domify( $output )->find('//input[@type="checkbox"]');
+
+ $this->assertNotEmpty( $el->attr( 'checked' ) );
+ }
+
function testCheckbox() {
$choices = array( 'foo', 'bar' );

0 comments on commit 2f7f9a1

Please sign in to comment.