wiki.techinc.nl/tests/phpunit/unit/includes/user
Daimona Eaytoy 090599c048 Simplify timezone-related code for user preferences
This patch simplifies and fixes a few issues in code related to the
'timecorrection' user setting:
- Always re-apply UserTimeCorrection normalization to the preference
  value, although it should be already normalized
- Avoid duplicating code from UserTimeCorrection, both for the
  pipe-splitting and the offset computation/fallback
- Use better variable names
- Inject an ITextFormatter for generating the dropdown options, instead
  of a ContextSource (ew) or a Language, removing calls to wfMessage as
  well. Note that the ITextFormatter is not injected into the
  preferences factory because the eventual goal is to move the code to a
  new HTMLFormField class.
- In TimezoneFilter, remove a redundant check: the value comes from the
  form, and the option for using the system time is always "System|XXX",
  never just "System". This seems to have been introduced in
  I2cadac00e46dff2bc7d81ac2f294ea2ae4e72f47; the previous code was only
  comparing $data[0], and not $tz. Change the test accordingly and add a
  test case.
- Add missing star to docblocks in UserTimeCorrection, as well as a
  missing int cast.
- Fix typo and other style issues in UserTimeCorrectionTest
- Bonus: add missing docblock star in HTMLApiField

Bug: T309629
Change-Id: Iab35eb17259826429e4b6bc1ba7385ab57884e98
2022-09-12 12:23:48 +00:00
..
CentralId unit tests: Use MainConfigNames constant to refer configs 2022-08-17 22:33:58 +02:00
TempUser TempUser: ScrambleMapping 2022-05-16 17:36:22 +00:00
ActorCacheTest.php Keep ActorStore caches consistent on user rename 2021-04-26 14:02:00 -07:00
ActorStoreFactoryTest.php unit tests: Use MainConfigNames constant to refer configs 2022-08-17 22:33:58 +02:00
StaticUserOptionsLookupTest.php Remove $actor field from UsererIdentityValue 2021-04-13 18:18:06 +00:00
UserArrayFromResultTest.php IResultWrapper::next() now returns void 2022-05-02 10:43:51 +03:00
UserGroupManagerFactoryTest.php Inject JobQueueGroup into UserGroupManager 2021-07-31 07:09:27 +00:00
UserIdentityValueTest.php UserIdentityValue: Introduce convenience static factory methods 2021-05-05 11:25:09 -07:00
UserNamePrefixSearchTest.php user: Remove support for UserIdentity audience from UserNamePrefixSearch 2022-03-25 01:11:39 +00:00
UserNameUtilsTest.php unit tests: Use MainConfigNames constant to refer configs 2022-08-17 22:33:58 +02:00
UserTimeCorrectionTest.php Simplify timezone-related code for user preferences 2022-09-12 12:23:48 +00:00