Why:
* Maintenance scripts in core have bolierplate code that is
added before and after the class to allow directly running
the maintenance script.
* Running the maintenance script directly has been deprecated
since 1.40, so this boilerplate code is only to support a now
deprecated method of running maintenance scripts.
* This code cannot also be marked as covered, due to PHPUnit
not recognising code coverage for files.
* Therefore, it is best to ignore this boilerplate code in code
coverage reports as it cannot be marked as covered and also
is for deprecated code.
What:
* Wrap the boilerplate code (requiring Maintenance.php and then
later defining the maintenance script class and running if the
maintenance script was called directly) with @codeCoverageIgnore
comments.
* Some files use a different boilerplate code, however, these
should also be marked as ignored for coverage for the same
reason that coverage is not properly reported for files.
Bug: T371167
Change-Id: I32f5c6362dfb354149a48ce9c28da9a7fc494f7c
Why:
* The maintenance scripts in core are mostly untested and testing
the less complex scripts will improve the test coverage in core.
What:
* Add integration tests for resetPageRandom.php
* Update resetPageRandom.php to indicate that both the --to and
--from parameters are required, as this is checked for in
::execute.
Bug: T371167
Change-Id: Ieb46edf2b2e1571e2bec50a0d79bed4085da8894
And start using them instead of wfGetDB(), LB/LBF connection methods or
worse, $this->getDB().
$this->getDB() reuses the database object regardless of whether you're
calling a replica or primary, leading to returning a replica on a
primary and other way around.
Bug: T330641
Change-Id: I9e2cf85ca277022284fc26b9f37db57bd12aaa81
These options weren't actually reading the option values, just
returning `1`, which would turn into `"19700101000001"`.
Bug: T291331
Change-Id: I93e11f18dc81b3875e0d3797e67553f7365ce963