X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fapi%2FApiMessageTest.php;h=70114c2593b66f5e59d0ddb5ff8217874546ff24;hb=4eace785e66d199cb8fe1ec224bdc49831949a6d;hp=e405b3b89592ad57d7e69446857465c9a529b8e1;hpb=c8d361a38027ef5d808225b8a83f15417248aa67;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" ], ]; }