Commit graph

13 commits

Author SHA1 Message Date
Reedy
75640200fb tests: Namespace api tests
Bug: T357823
Change-Id: I0d7cc2c9b166d5e5b913c1305f7cee017fe377af
2024-02-18 15:47:04 +00:00
Reedy
85396a9c99 tests: Fix @covers and @coversDefaultClass to have leading \
Change-Id: I5629f91387f2ac453ee4341bfe4bba310bd52f03
2024-02-16 22:43:56 +00:00
zoranzoki21
a14076932e MessagesSr: Use aliases in Serbian Latin script as well
Based on the content of the MessagesSh.php file.

Bug: T185421
Bug: T349093
Change-Id: I91fcbe77e5d2fcc27398f116003f48f496f25dfb
2023-10-28 14:22:57 +00:00
Tim Starling
5e30a927bc tests: Make some PHPUnit data providers static
Just methods where adding "static" to the declaration was enough, I
didn't do anything with providers that used $this.

Initially by search and replace. There were many mistakes which I
found mostly by running the PHPStorm inspection which searches for
$this usage in a static method. Later I used the PHPStorm "make static"
action which avoids the more obvious mistakes.

Bug: T332865
Change-Id: I47ed6692945607dfa5c139d42edbd934fa4f3a36
2023-03-24 02:53:57 +00:00
Martin Urbanec
80bf808bb6 ApiQueryLanguageinfoTest: Do not pass a float to setFakeTime
ConvertibleTimestamp::setFakeTime is documented to
only take callbacks returning an int. ApiQueryLanguageinfoTest
violated this expectation, resulting in test breakage
(see I06c625abe351b2f189f5dbf6f331d34bb56004b2).

To get some integers to chose from, bump MAX_EXECUTE_SECONDS
to three.

Bug: T329609
Change-Id: I82d49a5e3a52c14dbd7e5324eb4c75cf7c33f3d2
2023-02-14 11:53:42 +00:00
Acamicamacaraca
a573bea01b Implement LanguageConverter for sh.wiki
This patch will implement a one-way transliterator (Latin->Cyrillic), per community consensus.

Bug: T268033
Change-Id: I6f3e7efe3630e9960584dca3a5ee55cb92ea722c
Co-Authored-By: Deni <deni@deni.dk>
Co-Authored-By: Winston Sung <winston21.sung@gmail.com>
2022-11-15 06:29:11 +00:00
Tim Starling
0077c5da15 Use short array destructuring instead of list()
Introduced in PHP 7.1. Because it's shorter and looks nice.

I used regex replacement.

Change-Id: I0555e199d126cd44501f859cb4589f8bd49694da
2022-10-21 15:33:37 +11:00
Func
b5f3400c27 ApiQueryLanguageinfo: Allow fetching variant names from API
Variant names is stored in 'variantname-xx' messages and different from
language names.

Bug: T302200
Change-Id: If1b16f12a6867de7caa9a28e0370745780006bec
2022-10-05 14:35:40 +00:00
Fomafix
6839b85994 Step 1 of renaming sr-ec and sr-el to sr-cyrl and sr-latn
The language codes sr-ec and sr-el are not conform to BCP 47.
BCP 47 explicit mentions sr-Latn and sr-Cyrl as examples.

This change adds support for the language codes sr-cyrl and sr-latn
as fallback languages of the language codes sr-ec and sr-el. This
allows to rename the message files and the system messages without
changing the language codes yet.

The next step is to rename the language codes in Translatewiki as
described in https://translatewiki.net/wiki/Renaming_language_codes
Also local system messages in MediaWiki:*/sr-ec and MediaWiki:*/sr-el
can moved to MediaWiki:*/sr-cyrl and MediaWiki:*/sr-latn.

The final step is the change I75da0af35a2066e7963e50c56c99daf1e07c55e6
to complete the rename of the language codes.

Bug: T117845
Change-Id: I666fbdea89ccf21aab6ca1849adf22813dec052e
2022-07-10 21:19:34 +00:00
Umherirrender
9b41241cc8 api: Use fake timer to test ApiQueryLanguageinfo
The difference is that previously we used microtime(), which provides a
float, and now time() is used, which provides an int, but there is no
difference for the comparison.

Change-Id: If1463e0fc2a2526ab4d2af64830b73ae3bf330f6
2021-08-04 02:27:04 +00:00
libraryupgrader
5357695270 build: Updating dependencies
composer:
* mediawiki/mediawiki-codesniffer: 36.0.0 → 37.0.0
  The following sniffs now pass and were enabled:
  * Generic.ControlStructures.InlineControlStructure
  * MediaWiki.PHPUnit.AssertCount.NotUsed

npm:
* svgo: 2.3.0 → 2.3.1
  * https://npmjs.com/advisories/1754 (CVE-2021-33587)

Change-Id: I2a9bbee2fecbf7259876d335f565ece4b3622426
2021-07-22 03:36:05 +00:00
Umherirrender
a1de8b8700 Tests: Mark more more closures as static
Result of a new sniff I25a17fb22b6b669e817317a0f45051ae9c608208

Bug: T274036
Change-Id: I695873737167a75f0d94901fa40383a33984ca55
2021-02-09 02:55:57 +00:00
Aaron Schulz
815912062f Move ApiQuery* tests under the /query subdirectory
Consistency aside, this is useful for grouping more tests
into separate threads when using directory based suites.

Bug: T50217
Change-Id: Ife9acd5990c4ae4a5fc18371559e93d7d86fb57d
2020-10-30 03:31:12 +00:00
Renamed from tests/phpunit/includes/api/ApiQueryLanguageinfoTest.php (Browse further)