wiki.techinc.nl/tests/phpunit/structure
Bartosz Dziewoński 0c0d50ce81 Fix specifying messages with params as arrays in API documentation
Follow-up to 12a4c08ad8.
I didn't review it carefully enough to notice that when these
functions return arrays, they contain a message key and parameters,
not a key and fallback keys (while other API documentation message
code uses fallback keys).

Instead of `$this->msg( $msg )`, this code must be written as
`is_array( $msg ) ? $this->msg( ...$msg ) : $this->msg( $msg )`
or `$this->msg( Message::newFromSpecifier( $msg ) )`, both of which
are ugly, but the latter looks a bit better to me.

Bonus changes:
* Add documentation to prevent a repeat of this mistake in the future
* Remove some unreachable dieDebug() calls (the Message class already
  throws for bad inputs)

It seems that we don't have any definitions using such arrays
in the core API classes. There are only a few uses in extensions,
e.g. AbuseFilter's 'apihelp-query+abuselog-param-filter' message,
which is passed the wrong parameter without this change.

Bug: T372988
Change-Id: I44c1c3c7d0c069e500c85a58c27e9b675b0b68ee
2024-08-21 13:26:02 +00:00
..
AbstractSchemaValidationTest.php Merge @dataProviders in AbstractSchemaValidationTest 2024-07-19 10:18:29 +00:00
ApiPrefixUniquenessTest.php Avoid DB access in more non-Database tests 2023-08-06 16:07:27 +00:00
ApiStructureTest.php Fix specifying messages with params as arrays in API documentation 2024-08-21 13:26:02 +00:00
AutoLoaderStructureTest.php Replace substr with cleaner string methods 2023-05-20 15:40:21 +02:00
AvailableRightsTest.php Use MediaWikiIntegrationTestCase::getConfVar in tests 2024-08-06 12:52:34 +00:00
BundleSizeTestBase.php Use MediaWikiIntegrationTestCase::getConfVar in tests 2024-08-06 12:52:34 +00:00
CodexMessageDefinitionTest.php tests: Add a test for Codex i18n messages 2024-08-12 15:30:11 -07:00
CodexTokenDefaultsTest.php mediawiki.skin.defaults.less: Add neutral values for all Codex tokens 2023-03-15 17:23:51 -07:00
ContentHandlerFunctionalTest.php tests: Use namespaced classes (2) 2024-06-13 23:21:02 +02:00
DatabaseIntegrationTest.php Change uses of getDBLoadBalancerFactory() to getConnectionProvider() 2024-01-22 22:27:45 +01:00
DumpableObjectsTest.php tests: Use namespaced classes 2023-12-11 15:59:55 +01:00
ExtensionJsonValidationTest.php Add MediaWiki\Registration namespace to registration classes 2024-08-10 10:08:22 +00:00
PasswordPolicyStructureTest.php tests: Make some PHPUnit data providers static 2023-03-24 02:53:57 +00:00
PHPUnitConfigTest.php Clean up tests 2024-02-12 09:25:25 +01:00
ResourcesTest.php ResourcesTest: Test 'packageFiles' existence too 2024-04-16 17:58:03 +00:00
RestStructureTest.php getParamSettings prohibited from using array type 2024-07-25 10:09:02 +00:00
ScopeStructureTest.php Add @coversNothing to all structure tests 2022-10-07 03:21:54 +02:00
SettingsTest.php Add MediaWiki\Registration namespace to registration classes 2024-08-10 10:08:22 +00:00
SpecialPageFatalTest.php Add Special:RestSandbox for exploring REST API 2024-06-13 21:40:36 +02:00
StructureTest.php Add @coversNothing to all structure tests 2022-10-07 03:21:54 +02:00