TitleTest: Break secure and split test into two tests with providers
[mediawiki.git] / tests / phpunit / includes / api / format / ApiFormatTestBase.php
blob5f6d53cedd9ff820897f994012be4d21d277c817
1 <?php
3 abstract class ApiFormatTestBase extends ApiTestCase {
5 /**
6 * @param string $format
7 * @param array $params
8 * @param array $data
10 * @return string
12 protected function apiRequest( $format, $params, $data = null ) {
13 $data = parent::doApiRequest( $params, $data, true );
15 /** @var ApiMain $module */
16 $module = $data[3];
18 $printer = $module->createPrinterByName( $format );
19 $printer->setUnescapeAmps( false );
21 $printer->initPrinter( false );
23 ob_start();
24 $printer->execute();
25 $out = ob_get_clean();
27 $printer->closePrinter();
29 return $out;