X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fphpunit%2Fincludes%2Fapi%2FApiMessageTest.php;h=70114c2593b66f5e59d0ddb5ff8217874546ff24;hb=1a62e51a00321eb6674e27cdff57c683703a5579;hp=e405b3b89592ad57d7e69446857465c9a529b8e1;hpb=8bb5a6c461c31ee5ce6874548246fc2c520686f6;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/api/ApiMessageTest.php b/tests/phpunit/includes/api/ApiMessageTest.php index e405b3b895..70114c2593 100644 --- a/tests/phpunit/includes/api/ApiMessageTest.php +++ b/tests/phpunit/includes/api/ApiMessageTest.php @@ -1,5 +1,7 @@ assertSame( 'baz', $msg->getApiCode() ); + // Weird "message key" + $msg = new ApiMessage( " bar\nbaz" ); + $this->assertSame( '_foo__bar_baz', $msg->getApiCode() ); + // BC case $msg = new ApiMessage( 'actionthrottledtext' ); $this->assertSame( 'ratelimited', $msg->getApiCode() ); @@ -70,6 +76,9 @@ class ApiMessageTest extends MediaWikiTestCase { return [ [ '' ], [ 42 ], + [ 'A bad code' ], + [ 'Project:A_page_title' ], + [ "WTF\nnewlines" ], ]; }