wiki.techinc.nl/tests/phpunit/includes/api/format/ApiFormatTestBase.php
umherirrender 092cd8ee31 Fixed some @params documentation (tests)
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.
Also added some missing @param.

Change-Id: Ic8aaf0a93796b97d0fa4617c1f86ff59f4b36131
2014-04-17 20:43:42 +02:00

32 lines
588 B
PHP

<?php
abstract class ApiFormatTestBase extends ApiTestCase {
/**
* @param string $format
* @param array $params
* @param array $data
*
* @return string
*/
protected function apiRequest( $format, $params, $data = null ) {
$data = parent::doApiRequest( $params, $data, true );
/** @var ApiMain $module */
$module = $data[3];
$printer = $module->createPrinterByName( $format );
$printer->setUnescapeAmps( false );
$printer->initPrinter( false );
ob_start();
$printer->execute();
$out = ob_get_clean();
$printer->closePrinter();
return $out;
}
}