wiki.techinc.nl/tests/phpunit/includes/api/format/ApiFormatTestBase.php

32 lines
586 B
PHP
Raw Normal View History

2011-01-03 21:36:49 +00:00
<?php
require_once dirname( dirname( __FILE__ ) ) . '/ApiSetup.php';
abstract class ApiFormatTestBase extends ApiTestSetup {
protected function apiRequest( $format, $params, $data = null ) {
$data = parent::doApiRequest( $params, $data, true );
$module = $data[3];
$printer = $module->createPrinterByName( $format );
$printer->setUnescapeAmps( false );
2011-01-03 21:36:49 +00:00
$printer->initPrinter( false );
2011-01-03 21:36:49 +00:00
ob_start();
$printer->execute();
$out = ob_get_clean();
$printer->closePrinter();
return $out;
}
function setupUser() {
/* Do not setup a user here */
}
2011-01-03 21:36:49 +00:00
}