mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-28 07:50:24 +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 |
||
---|---|---|
.. | ||
AbuseFilterView.php | ||
AbuseFilterViewDiff.php | ||
AbuseFilterViewEdit.php | ||
AbuseFilterViewExamine.php | ||
AbuseFilterViewHistory.php | ||
AbuseFilterViewImport.php | ||
AbuseFilterViewList.php | ||
AbuseFilterViewRevert.php | ||
AbuseFilterViewTestBatch.php | ||
AbuseFilterViewTools.php |