Improve testing for ApiFormatBase subclasses
authorBrad Jorsch <bjorsch@wikimedia.org>
Wed, 17 Dec 2014 21:48:03 +0000 (16:48 -0500)
committerBrad Jorsch <bjorsch@wikimedia.org>
Tue, 23 Dec 2014 19:55:23 +0000 (14:55 -0500)
commit39703e93187bc0aa8059fbfa666b3605424b90f3
tree5ce64c75859e1652d52a28d6e6f81dd360e76eff
parent2e5bfb55d73d93867c5a1fcb091e6beab2ef56db
Improve testing for ApiFormatBase subclasses

I7b37295e is going to be changing around how ApiResult works,
which is going to need corresponding changes in the formatters. So it
would probably be a good idea to have a decent starting point to catch
any breakage. The non-backwards-compatible changes to ApiFormatTestBase
shouldn't be a concern, as no extensions in Gerrit reference this class
or any /ApiFormat.*Test/ class.

This also fixes two small bugs in ApiFormatWddx (null handling and
spacing for non-fm slow path) discovered during testing, and works
around some HHVM wddx extension bugs.

Bug: T85236
Change-Id: I9cdf896e7070ed51e42625d61609ad9ef91cd567
includes/api/ApiFormatWddx.php
tests/phpunit/includes/api/format/ApiFormatDbgTest.php [new file with mode: 0644]
tests/phpunit/includes/api/format/ApiFormatDumpTest.php [new file with mode: 0644]
tests/phpunit/includes/api/format/ApiFormatJsonTest.php
tests/phpunit/includes/api/format/ApiFormatNoneTest.php
tests/phpunit/includes/api/format/ApiFormatPhpTest.php
tests/phpunit/includes/api/format/ApiFormatTestBase.php
tests/phpunit/includes/api/format/ApiFormatTxtTest.php [new file with mode: 0644]
tests/phpunit/includes/api/format/ApiFormatWddxTest.php
tests/phpunit/includes/api/format/ApiFormatXmlTest.php [new file with mode: 0644]