dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "rdbms: treat cloned temporary tables as "effective write" targets"
[lhc/web/wiklou.git]
/
tests
/
phpunit
/
includes
/
api
/
ApiMessageTest.php
diff --git
a/tests/phpunit/includes/api/ApiMessageTest.php
b/tests/phpunit/includes/api/ApiMessageTest.php
index
e405b3b
..
70114c2
100644
(file)
--- a/
tests/phpunit/includes/api/ApiMessageTest.php
+++ b/
tests/phpunit/includes/api/ApiMessageTest.php
@@
-1,5
+1,7
@@
<?php
<?php
+use Wikimedia\TestingAccessWrapper;
+
/**
* @group API
*/
/**
* @group API
*/
@@
-36,6
+38,10
@@
class ApiMessageTest extends MediaWikiTestCase {
$msg = new ApiMessage( 'apiwarn-baz' );
$this->assertSame( 'baz', $msg->getApiCode() );
$msg = new ApiMessage( 'apiwarn-baz' );
$this->assertSame( 'baz', $msg->getApiCode() );
+ // Weird "message key"
+ $msg = new ApiMessage( "<foo> bar\nbaz" );
+ $this->assertSame( '_foo__bar_baz', $msg->getApiCode() );
+
// BC case
$msg = new ApiMessage( 'actionthrottledtext' );
$this->assertSame( 'ratelimited', $msg->getApiCode() );
// BC case
$msg = new ApiMessage( 'actionthrottledtext' );
$this->assertSame( 'ratelimited', $msg->getApiCode() );
@@
-70,6
+76,9
@@
class ApiMessageTest extends MediaWikiTestCase {
return [
[ '' ],
[ 42 ],
return [
[ '' ],
[ 42 ],
+ [ 'A bad code' ],
+ [ 'Project:A_page_title' ],
+ [ "WTF\nnewlines" ],
];
}
];
}