wiki.techinc.nl/tests/phpunit/includes/htmlform/HTMLFormTest.php
Kunal Mehta 01f7176c8b Add @covers tags to HTMLForm test
Change-Id: I41cc4867b071ee9a58a43760fc4a8b301cda558e
2017-12-27 17:47:17 +00:00

23 lines
512 B
PHP

<?php
/**
* @covers HTMLForm
*/
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 );
}
}