Skip to content
Browse files

add testSingleCheckbox()

  • Loading branch information...
1 parent fd0e027 commit c1d6c4578bfc2cc55527edfad911186a9e36164e @scribu committed Feb 21, 2013
Showing with 21 additions and 0 deletions.
  1. +21 −0 tests/test-forms.php
View
21 tests/test-forms.php
@@ -83,6 +83,27 @@ function testRadio() {
$this->assertEquals( $choices[0], $checked->attr('value') );
}
+ function testSingleCheckbox() {
+ $output = scbForms::input( array(
+ 'name' => 'fruit',
+ 'type' => 'checkbox',
+ 'value' => 'orange',
+ 'desc' => 'Orange'
+ ) );
+
+ $label = self::domify( $output )->find('//label');
+
+ $this->assertEquals( ' Orange', $label->text() );
+
+ $el = $label->find('.//input[@type="checkbox"]');
+
+ $this->assertEquals( 'fruit', $el->attr('name') );
+
+ $this->assertEquals( 'orange', $el->attr('value') );
+
+ $this->assertEmpty( $el->attr( 'checked' ) );
+ }
+
function testCheckbox() {
$choices = array( 'foo', 'bar' );

0 comments on commit c1d6c45

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