aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/language/LanguageConverterFactoryTest.php
Commit message (Collapse)AuthorAgeFilesLines
* Add @phpcs-require-sorted-array to language code arraysFomafix2025-02-111-42/+429
| | | | Change-Id: I883d128034fa8c8d6d6338358eeedc6b7c5f3df9
* tests: Use namespaced classesUmherirrender2024-10-211-0/+1
| | | | | | | | Changes to the use statements and some additions are done automatically via script This also updates @covers tag for the namespaced classes Change-Id: I859ba6d05018c99710b744e2becab432410d3bca
* LanguageConverter: Added support for mni-Beng in mniwikinokibsarkar2024-07-061-1/+12
| | | | | | | | | | | This is the Language Converter from Meitei Script to Bengali Script in mniwiki. I don't know the language. I got help from a native speaker User:Haoreima. The original prototype was in a Python Library written by myself. It only converts the words that have Meitei characters (U+ABC0..U+ABFF). The original prototype is already being used in mniwiki via Gadget and a Bot. Bug: T357853 Change-Id: I810f18050f29efa38b2a646d96644e298af47c50
* language: Widen `@covers` tags in phpunit testsTimo Tijhof2024-06-251-17/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a few missing `@group Language` tags as well. Remove stray `@group Cache` from two classes since "Cache" is not a MediaWiki core component (per T248519 and related tasks, we did long ago in Bugzilla have a "MediaWiki-Cache" category, but that's since been re-orged into BagOStuff, HTTP-Cache, and Parser/ParserCache, and Internationalization/LocalisationCache, per the description at <https://phabricator.wikimedia.org/project/profile/1329/>.) Ref https://gerrit.wikimedia.org/r/q/owner:Krinkle+is:merged+message:Widen > Given all called methods are de-facto and liberally claimed, and > that we keep the coverage limited to the subject class, it maintains > the spirit and intent by listing the class explicitly instead. > > PHPUnit offers a more precise tool when you need it (i.e. when testing > legacy monster/god classes), but for well-written code, the > class-wide tag is exactly what you want. > > We lose useful coverage and waste valuable time on keeping tags > accurate through refactors (or worse, forget to do so). > Tracking tiny per-method details wastes time in realizing (and > fixing) when people inevitably don't keep them in sync, and time > lost in finding uncovered code to write tests to realize it was > already covered but "not yet claimed". Bug: T364652 Change-Id: I9cfc4c210b90bfed6fd988a2525f80f5f5ee4870
* tests: Use namespaced classes (1)Umherirrender2024-06-141-0/+1
| | | | | | | Changes to the use statements done automatically via script Addition of missing use statement done manually Change-Id: Iae45fa269363be8ee05c598ea6926514ce817762
* Implement language converter for Standard Moroccan Amazigh (zgh)Jon Harald Søby2024-04-111-1/+10
| | | | | | | | | | | | | Requested by the zgh community in the Wikimedia Incubator at [1]; the converter is the same as for Shilha (`shi`); the main difference between the two languages is that the main script for `zgh` is Tifinagh, which can't be losslessly converted to the Latin script (the former is unicameral, the latter is bicameral), so the converter and configuration added here is essentially one-directional. [1] https://incubator.wikimedia.org/wiki/Special:PermaLink/6060805 Change-Id: I483a1594f001226439497f0870176e9a1e447458
* Follow-up "ZhConverter: Fix language variant fallback chain"Winston Sung2024-03-081-8/+8
| | | | | | | | | | | | | | * Removed 'zh' from all variants to prevent unexpected conversion (e.g., Hant in zh-cn converted to Hani with -{H|zh:Hani; zh-hant:Hant;}- , which was referring to -{H|Hani=>zh-hant:Hant; Hani=>zh-tw:Hant; Hani=>zh-hk:Hant; Hani=>zh-mo:Hant;}- instead of -{H|zh-hans:Hani; zh-hant:Hant;}- ) Bug: T352554 Change-Id: I58db0f92e911dcce38beb2d9835681a8158328db
* tests: Fix @covers and @coversDefaultClass to have leading \Reedy2024-02-161-1/+1
| | | | Change-Id: I5629f91387f2ac453ee4341bfe4bba310bd52f03
* ZhConverter: Fix language variant fallback chainWinston Sung2024-02-151-8/+8
| | | | | | | | | | | | | | Fix the fallback chain for the language converter for zh by: * Changed fallback order into * zh-hk' <=> 'zh-mo' first, 'zh-hant' second * 'zh-sg' <=> 'zh-my' first, 'zh-hans' second * Added 'zh' to all variants (except 'zh') to reduce "converter-manual-rule-error" messages ('Error detected in manual language conversion rule'). Bug: T352554 Change-Id: Ia006c0cb00bcc809f32267b1c1feca773daadb3b
* LanguageConverterFactory: Use ServiceOptionsBartosz Dziewoński2023-12-111-12/+22
| | | | Change-Id: I8d374b51511a2873dce646aa453c5e0e2c076a14
* Drop LanguageConverterFactory::isTitleConversionDisabled(), deprecated in 1.36James D. Forrester2023-12-081-8/+0
| | | | Change-Id: I8949f88866ae6bb343edc5febc34c1f5cae83831
* Remove language coverter for KazakhAmir Sarabadani2023-11-201-24/+1
| | | | | | | | | | | | This has been constantly mentioned as buggy and broken and there is no official version of latin or Arabic (see the ticket for more details). This can be turned back as an extension if needed by third party users. Bug: T350684 Bug: T268143 Depends-On: I6180dca2c49b3119751766268acc56087aaf8414 Change-Id: Ifbf3c8954d885daf891f8d9efc11743d898302f0
* Use $this->getServiceContainer() in testsFomafix2023-10-171-9/+8
| | | | | | | | | | Use $this->getServiceContainer() instead of MediaWikiServices::getInstance() in tests where possible. Change-Id: I798b2941f37a43b9073072935b54c3ea0cfe70dd
* Remove ak from coreSrishakatux2023-08-211-1/+1
| | | | | | | | - Removed ak from `Names.php`, `LanguageConvertorFactoryTest.php` files - Deleted `MessagesAk.php` file Bug: T333765 Change-Id: Ic43b4a556158c60a9f429023b0d9b78666642680
* Fix space after comma in single-line array declarationAmir Sarabadani2023-07-241-1/+1
| | | | | | | | | We are introducing a new phpcs sniff to make sure this doesn't happen That sniff found this so far. Bug: T342297 Change-Id: Ibce3f3d28e7d2cb5b0ff7230f584e76446965ddc
* tests: Use instanceof in LanguageConverterFactoryTestUmherirrender2023-07-211-19/+19
| | | | | | | | | | Also use ::class for class names instanceof is not exactly the same as compare with get_class, but that is only relevant for sub-sub-types, which are not in use on converters Change-Id: Ib07e14bd57211920d72f7e27668bf32c604ae03c
* Revert "Implement Language Converter for yue (Cantonese)"Winston Sung2023-06-131-13/+1
| | | | | | | | This partially reverts Iee936baa0a42370a723b34b09a791bf0917dcdf4 (commit 504c1a9faf6f62a629bc3f4eb4b91213a1fd006a). Bug: T59106 Change-Id: I935cc23cbc2838c4338c5fb2220d8ec4cfb750a9
* Implement Language Converter for yue (Cantonese)Liangent2023-05-201-3/+15
| | | | | | | This only implement unidirectional yue-Hant => yue-Hans per community consensus. Bug: T59106 Change-Id: Iee936baa0a42370a723b34b09a791bf0917dcdf4
* Implement Language Converter for wuu (Wu)Lt28182023-05-201-4/+18
| | | | | Bug: T59138 Change-Id: I62507198ad4e467bf4c09f3545ce77188f47903e
* tests: Make some PHPUnit data providers staticUmherirrender2023-05-201-2/+2
| | | | | | | | | Initally used a new sniff with autofix (T333745), but some provide are defined non-static in TestBase class and need more work to make them static in a compatible way Bug: T332865 Change-Id: I889d33424f0c01fb26f2d86f8d4fc3de3e568843
* tests: Move all language converter tests into /includes/Umherirrender2023-02-011-0/+514
Move tests from /languages/ to /includes/language/ similiar to the classes in f5644ba Clean up suite config too not longer run that folder as test, remove from coverage, there no php files to cover Remove converter tests from Language*Test files, all identical to the *ConverterTest cases (or remove the whole file) Change-Id: I098ba241bd61d8ed2ee9b65393416077e3544e79