MediaWiki  REL1_19
ApiFormatTestBase.php
Go to the documentation of this file.
00001 <?php
00002 
00003 abstract class ApiFormatTestBase extends ApiTestCase {
00004         protected function apiRequest( $format, $params, $data = null ) {
00005                 $data = parent::doApiRequest( $params, $data, true );
00006 
00007                 $module = $data[3];
00008                 
00009                 $printer = $module->createPrinterByName( $format );
00010                 $printer->setUnescapeAmps( false );
00011 
00012                 $printer->initPrinter( false );
00013 
00014                 ob_start();
00015                 $printer->execute();
00016                 $out = ob_get_clean();
00017                 
00018                 $printer->closePrinter();
00019 
00020                 return $out;
00021         }
00022 }