X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fapi%2FApiParseTest.php;h=f01a670b711590bf37d816aa5012f3cb5a49ce77;hb=4e6810e4a2c1d821d8d108c7974ac16917561764;hp=b72a4f8a8b8b27879af44e699ce97dbeafecd543;hpb=8b0e022a8c543a0cb2e515ae5a2e3ff35fd96b6f;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/api/ApiParseTest.php b/tests/phpunit/includes/api/ApiParseTest.php index b72a4f8a8b..f01a670b71 100644 --- a/tests/phpunit/includes/api/ApiParseTest.php +++ b/tests/phpunit/includes/api/ApiParseTest.php @@ -23,12 +23,10 @@ class ApiParseTest extends ApiTestCase { 'page' => $somePage ] ); $this->fail( "API did not return an error when parsing a nonexistent page" ); - } catch ( UsageException $ex ) { - $this->assertEquals( - 'missingtitle', - $ex->getCodeString(), + } catch ( ApiUsageException $ex ) { + $this->assertTrue( ApiTestCase::apiExceptionHasCode( $ex, 'missingtitle' ), "Parse request for nonexistent page must give 'missingtitle' error: " - . var_export( $ex->getMessageArray(), true ) + . var_export( self::getErrorFormatter()->arrayFromStatus( $ex->getStatusValue() ), true ) ); } }