]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blobdiff - tests/phpunit/includes/htmlform/HTMLFormTest.php
MediaWiki 1.30.2
[autoinstallsdev/mediawiki.git] / tests / phpunit / includes / htmlform / HTMLFormTest.php
diff --git a/tests/phpunit/includes/htmlform/HTMLFormTest.php b/tests/phpunit/includes/htmlform/HTMLFormTest.php
new file mode 100644 (file)
index 0000000..b7e0053
--- /dev/null
@@ -0,0 +1,21 @@
+<?php
+
+
+class HTMLFormTest extends MediaWikiTestCase {
+       public function testGetHTML_empty() {
+               $form = new HTMLForm( [] );
+               $form->setTitle( Title::newFromText( 'Foo' ) );
+               $form->prepareForm();
+               $html = $form->getHTML( false );
+               $this->assertRegExp( '/<form\b/', $html );
+       }
+
+       /**
+        * @expectedException LogicException
+        */
+       public function testGetHTML_noPrepare() {
+               $form = new HTMLForm( [] );
+               $form->setTitle( Title::newFromText( 'Foo' ) );
+               $form->getHTML( false );
+       }
+}