The syntax highlighting applied to the XML format is not all that great, and applying it to other formats is just wrong. Instead of doing it ourselves, let's just add a hook and let Extension:SyntaxHighlight_GeSHi do it for us. But for that to work, we have to add RL support to the pretty-printed output, which means OutputPage. At the same time, lets internationalize the header. Bug: 65403 Change-Id: I04b1a3842abdf1fb360c54aa7164fc7cd2e50f4b
29 lines
548 B
PHP
29 lines
548 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 );
|
|
|
|
ob_start();
|
|
$printer->initPrinter( false );
|
|
$printer->execute();
|
|
$printer->closePrinter();
|
|
$out = ob_get_clean();
|
|
|
|
return $out;
|
|
}
|
|
|
|
}
|