diff options
Diffstat (limited to 'tests/phpunit/includes/api/format')
-rw-r--r-- | tests/phpunit/includes/api/format/ApiFormatPhpTest.php | 12 | ||||
-rw-r--r-- | tests/phpunit/includes/api/format/ApiFormatTestBase.php | 4 |
2 files changed, 7 insertions, 9 deletions
diff --git a/tests/phpunit/includes/api/format/ApiFormatPhpTest.php b/tests/phpunit/includes/api/format/ApiFormatPhpTest.php index 8209f591..a0bbb2dc 100644 --- a/tests/phpunit/includes/api/format/ApiFormatPhpTest.php +++ b/tests/phpunit/includes/api/format/ApiFormatPhpTest.php @@ -3,17 +3,15 @@ /** * @group API * @group Database + * @group medium */ class ApiFormatPhpTest extends ApiFormatTestBase { - function testValidPhpSyntax() { - + public function testValidPhpSyntax() { + $data = $this->apiRequest( 'php', array( 'action' => 'query', 'meta' => 'siteinfo' ) ); - + $this->assertInternalType( 'array', unserialize( $data ) ); - $this->assertGreaterThan( 0, count( (array) $data ) ); - - + $this->assertGreaterThan( 0, count( (array)$data ) ); } - } diff --git a/tests/phpunit/includes/api/format/ApiFormatTestBase.php b/tests/phpunit/includes/api/format/ApiFormatTestBase.php index a0b7b020..153f2cf4 100644 --- a/tests/phpunit/includes/api/format/ApiFormatTestBase.php +++ b/tests/phpunit/includes/api/format/ApiFormatTestBase.php @@ -5,7 +5,7 @@ abstract class ApiFormatTestBase extends ApiTestCase { $data = parent::doApiRequest( $params, $data, true ); $module = $data[3]; - + $printer = $module->createPrinterByName( $format ); $printer->setUnescapeAmps( false ); @@ -14,7 +14,7 @@ abstract class ApiFormatTestBase extends ApiTestCase { ob_start(); $printer->execute(); $out = ob_get_clean(); - + $printer->closePrinter(); return $out; |