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 "Fix index name in comment to "PHP_INFO""
[lhc/web/wiklou.git]
/
tests
/
phpunit
/
includes
/
api
/
ApiErrorFormatterTest.php
diff --git
a/tests/phpunit/includes/api/ApiErrorFormatterTest.php
b/tests/phpunit/includes/api/ApiErrorFormatterTest.php
index
a2c0d39
..
f36faf7
100644
(file)
--- a/
tests/phpunit/includes/api/ApiErrorFormatterTest.php
+++ b/
tests/phpunit/includes/api/ApiErrorFormatterTest.php
@@
-526,6
+526,10
@@
class ApiErrorFormatterTest extends MediaWikiLangTestCase {
* @param array $expect
*/
public function testGetMessageFromException( $exception, $options, $expect ) {
* @param array $expect
*/
public function testGetMessageFromException( $exception, $options, $expect ) {
+ if ( $exception instanceof UsageException ) {
+ $this->hideDeprecated( 'UsageException::getMessageArray' );
+ }
+
$result = new ApiResult( 8388608 );
$formatter = new ApiErrorFormatter( $result, Language::factory( 'en' ), 'html', false );
$result = new ApiResult( 8388608 );
$formatter = new ApiErrorFormatter( $result, Language::factory( 'en' ), 'html', false );
@@
-551,6
+555,10
@@
class ApiErrorFormatterTest extends MediaWikiLangTestCase {
* @param array $expect
*/
public function testGetMessageFromException_BC( $exception, $options, $expect ) {
* @param array $expect
*/
public function testGetMessageFromException_BC( $exception, $options, $expect ) {
+ if ( $exception instanceof UsageException ) {
+ $this->hideDeprecated( 'UsageException::getMessageArray' );
+ }
+
$result = new ApiResult( 8388608 );
$formatter = new ApiErrorFormatter_BackCompat( $result );
$result = new ApiResult( 8388608 );
$formatter = new ApiErrorFormatter_BackCompat( $result );
@@
-571,6
+579,12
@@
class ApiErrorFormatterTest extends MediaWikiLangTestCase {
}
public static function provideGetMessageFromException() {
}
public static function provideGetMessageFromException() {
+ Wikimedia\suppressWarnings();
+ $usageException = new UsageException(
+ '<b>Something broke!</b>', 'ue-code', 0, [ 'xxx' => 'yyy', 'baz' => 23 ]
+ );
+ Wikimedia\restoreWarnings();
+
return [
'Normal exception' => [
new RuntimeException( '<b>Something broke!</b>' ),
return [
'Normal exception' => [
new RuntimeException( '<b>Something broke!</b>' ),
@@
-591,7
+605,7
@@
class ApiErrorFormatterTest extends MediaWikiLangTestCase {
]
],
'UsageException' => [
]
],
'UsageException' => [
-
new UsageException( '<b>Something broke!</b>', 'ue-code', 0, [ 'xxx' => 'yyy', 'baz' => 23 ] )
,
+
$usageException
,
[],
[
'text' => '<b>Something broke!</b>',
[],
[
'text' => '<b>Something broke!</b>',
@@
-600,7
+614,7
@@
class ApiErrorFormatterTest extends MediaWikiLangTestCase {
]
],
'UsageException, wrapped' => [
]
],
'UsageException, wrapped' => [
-
new UsageException( '<b>Something broke!</b>', 'ue-code', 0, [ 'xxx' => 'yyy', 'baz' => 23 ] )
,
+
$usageException
,
[ 'wrap' => 'parentheses', 'code' => 'some-code', 'data' => [ 'foo' => 'bar', 'baz' => 42 ] ],
[
'text' => '(<b>Something broke!</b>)',
[ 'wrap' => 'parentheses', 'code' => 'some-code', 'data' => [ 'foo' => 'bar', 'baz' => 42 ] ],
[
'text' => '(<b>Something broke!</b>)',