mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-12 08:49:28 +00:00
c8c66b55bc
Trying to write unit tests, there are some things in the code that make it not well testable. Here, two of them are corrected: 1 - Use class constants instead of static variables inside a non-static method. Otherwise such variables won't be reset between tests. The change is made so that there'll be less impact on blame. 2 - Set af_enabled to true even in af_deleted is true as well. For three reasons: the first is that we already perform validation for this, so no need to secretly change the option to whatever we think would make sense. Second, this redundant validation makes some tests fail. Third: this way, if the user selects both enabled and deleted, when the warning is shown he'll indeed see that both checkboxes are selected. Before, he would only see wpFilterEnabled as selected. Change-Id: Ib7a0335fa7fb3b8a21765438a720205656c1ea09 |
||
---|---|---|
.. | ||
api | ||
pagers | ||
parser | ||
special | ||
Views | ||
AbuseFilter.php | ||
AbuseFilterChangesList.php | ||
AbuseFilterHooks.php | ||
AbuseFilterModifyLogFormatter.php | ||
AbuseFilterPreAuthenticationProvider.php | ||
AbuseFilterVariableHolder.php | ||
AbuseLogHitFormatter.php | ||
AFComputedVariable.php | ||
TableDiffFormatterFullContext.php |