wiki.techinc.nl/tests/phpunit/includes/htmlform/HTMLFormTest.php
Gergő Tisza e3d7978bc6 Enforce calling HTMLForm::prepareForm before displayForm
Bug: T133163
Change-Id: Idd5d117cb0dd65c195019dcd321cd4bf9024b426
2016-04-27 20:00:06 +01:00

21 lines
485 B
PHP

<?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 );
}
}