mediawiki-extensions-AbuseF.../tests/phpunit
Daimona Eaytoy 1bdf4e5351 Rewrite the VariableHolder code to translate deprecated variables
The current code was more of a subpar, temporary solution. However, we
need a stable solution in case more variables will be deprecated in the
future (T213006 fixes the problem for the past deprecation round). So,
instead of setting a hacky property, directly translate all variables
when loading the var dump. This is not only stable, but has a couple
micro-performance advantages:
 - Calling getDeprecatedVariables happens only once when loading the
   dump, and not every time a variable is accessed
 - No checks are needed when retrieving a variable,
   because names can always assumed to be new

Some simple benchmarks reveals a runtime reduction of 8-15% compared to
the old code (8% when it had varsVersion = 2, 15% for varsVersion = 1),
which comes at no cost together with increased readability and
stability. It ain't much, but it's honest work.

Change-Id: Ib32a92c4ad939790633aa63eb3ef8d4629488bea
2020-09-29 15:06:14 +00:00
..
unit Rewrite the VariableHolder code to translate deprecated variables 2020-09-29 15:06:14 +00:00
AbuseFilterConsequencesTest.php Add tests for 'upload' action 2020-09-28 11:53:53 +00:00
AbuseFilterDBTest.php Rewrite the VariableHolder code to translate deprecated variables 2020-09-29 15:06:14 +00:00
AbuseFilterParserEquivsetTest.php Introduce a KeywordsManager service 2020-09-28 23:03:52 +00:00
AbuseFilterSaveTest.php Give AbuseFilterSaveTest::testSaveFilter() a return value for selectRow 2020-09-24 18:25:26 +01:00
AbuseFilterVariableGeneratorDBTest.php tests: Create dedicated classes for VariableGenerators 2020-09-28 11:53:47 +00:00
UpdateVarDumpsTest.php Introduce a KeywordsManager service 2020-09-28 23:03:52 +00:00