wiki.techinc.nl/tests/phpunit/includes/cache
Timo Tijhof 128debb64b tests: Change use of AtEase to at operator
Follows-up I361fde0de7f4406bce6ed075ed397effa5be3359.

Per T253461, not mass-changing source code, but the use of the native
error silencing operator (@) is especially useful in tests because:

1. It requires any/all statements to be explicitly marked. The
   suppressWarnings/restoreWarnings sections encourage developers to
   be "lazy" and thus encapsulate more than needed if there are multiple
   ones near each other, which would ignore potentially important
   warnings in a test case, which is generally exactly the time when
   it is really useful to get warnings etc.

2. It avoids leaking state, for example in LBFactoryTest the
   assertFalse call would throw a PHPUnit assertion error (not meant
   to be caught by the local catch), and thus won't reach
   AtEase::restoreWarnings. This then causes later code to end up
   in a mismatching state and creates a confusing error_reporting
   state.

See .phpcs.xml, where the at operator is allowed for all test code.

Change-Id: I68d1725d685e0a7586468bc9de6dc29ceea31b8a
2022-02-24 21:29:51 +00:00
..
BacklinkCacheTest.php Clean up tests that misused the parameters of assertSame/Equals 2022-02-08 07:21:10 +00:00
GenderCacheTest.php Clean up tests that misused the parameters of assertSame/Equals 2022-02-08 07:21:10 +00:00
LinkBatchTest.php tests: Change use of AtEase to at operator 2022-02-24 21:29:51 +00:00
LinkCacheTest.php cache: Add four fields to LinkCache::getSelectFields 2021-12-14 15:10:49 +01:00
LinkCacheTestTrait.php LinkCache: soft deprecate addGoodLinkObj() 2021-09-10 16:00:02 +02:00
LocalisationCacheTest.php Replace PHPUnit ->returnValue() with ->willReturn() shortcut 2021-04-22 10:37:45 +02:00
MessageCacheTest.php phpunit: use ->getServiceContainer() in integration tests 2022-01-27 22:04:16 +01:00