Permalink
Browse files

added constructor parse tests

  • Loading branch information...
CaptainN committed Oct 23, 2012
1 parent ccc78d6 commit 55e9cf79f9b795198d646dccf5d3014bb1ef4c97
Showing with 19 additions and 0 deletions.
  1. +19 −0 tests/core_test.php
View
@@ -19,6 +19,17 @@ function test_parse_form()
$this->assertEqual( $this->form_html, $onceform->__toString() );
}
+ function test_parse_form_through_constructor()
+ {
+ $onceform = new OnceForm( $this->form_html );
+
+ $this->assertIsA( $onceform->doc, 'DOMDocument' );
+ $this->assertIsA( $onceform->form, 'DOMElement' );
+
+ // The onceform should spit out what it got.
+ $this->assertEqual( $this->form_html, $onceform->__toString() );
+ }
+
function test_add_form_func()
{
$onceform = new OnceForm();
@@ -28,6 +39,14 @@ function test_add_form_func()
$this->assertEqual( $this->form_html, $onceform->toString() );
}
+ function test_add_form_func_through_constructor()
+ {
+ $onceform = new OnceForm( 'the_form' );
+
+ // The onceform should spit out what it got.
+ $this->assertEqual( $this->form_html, $onceform->toString() );
+ }
+
}
?>
<?php function the_form() { ?>

0 comments on commit 55e9cf7

Please sign in to comment.