Commit graph

9 commits

Author SHA1 Message Date
Umherirrender
d36073cdcf tests: Make some PHPUnit data providers static
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
2023-05-20 01:05:27 +02:00
Kevin Israel
72b14c9459 IcuCollation: Remove unnecessary rtrim() and unset()
- MediaWiki no longer supports PHP versions that are old enough to
  include the null terminator in the sort key, so there's no need to
  remove it using rtrim(). See T137642 for more information.
- Simplify prefix comparison by setting the initial value of $prev to
  the empty string rather than false. A PHP array key can only be an
  integer or string, so there's no other reason to check for false.
- $letterMap is unset to "Reduce memory usage before caching", which
  made sense at the time (r80443 / eaeea84b44). In 2a86b5a17a, the
  code was refactored such that $letterMap goes out of scope before we
  save to the cache, so unset() should no longer be needed.

Change-Id: Id99ab3a6a29d037912f4ab3e817dba52d2ac24e8
2022-05-21 02:02:39 -04:00
James D. Forrester
a362b2cff0 CollationTest: Be more specific with @covers
Change-Id: I1470fbf55efb401867d1cc0e53ef1a66b9a1f21c
2021-09-08 13:46:58 +00:00
Umherirrender
5b3d3ef802 collation: Create CollationFactory service
Use ObjectFactory specs for collation classes
Avoid the language construction in the factory class,
make it a detail of the implementation of each class

Follow-Up of Ifc96f851e6091ce834dbaf0e91695c648a42169c

Bug: T286079
Change-Id: Ib581f64aec8619986fb8dd49ceee0524d59a1b84
2021-09-04 02:46:06 +02:00
Reedy
deb55049ae CollationTest: Stop checking for intl being loaded
Bug: T267669
Change-Id: I4ee41ebe09eac7864bb5b64d36ad6efb7f990b3b
2020-11-29 00:22:40 +00:00
Max Semenik
48a323f702 tests: Add explicit return type void to setUp() and tearDown()
Bug: T192167
Depends-On: I581e54278ac5da3f4e399e33f2c7ad468bae6b43
Change-Id: I3a21fb55db76bac51afdd399cf40ed0760e4f343
2019-10-30 14:31:22 -07:00
Umherirrender
5bd311b1a2 Add public as visibility in tests folder
Add public, protected or private to function missing a visibility
Enable the tests folder for the phpcs sniff

Change-Id: Ibefce76ea9984c47e08c94889ea2eafca7565e2c
2019-10-10 21:55:37 +02:00
Thiemo Mättig
ef470ebf7f Remove @param comments that literally repeat what the code says
These comments do not add anything. I argue they are worse than having
no comments, because I have to read them first to understand they
actually don't explain anything. Removing them makes room for actual
improvements in the future (if needed).

Change-Id: Iee70aad681b3385e9af282d5581c10addbb91ac4
2018-01-10 14:14:26 +01:00
Brian Wolff
73f5937047 Add collation for Bashkir (ba)
This is based on a numeric uppercase collation. Bashkir characters
will be remapped to the private use area for the purpose of sorting.

Bug: T162823
Change-Id: I65f1af0b57ff6ded7d464e39efd401f178a3519e
2017-05-10 04:17:46 +00:00
Renamed from tests/phpunit/includes/CollationTest.php (Browse further)