wiki.techinc.nl/tests/phpunit/mocks
Aryeh Gregor 0b9edb467b Get ~100% test coverage for ApiEditPage.php and fix a couple of bugs
Bugs fixed:

* The major one was that appendtext and prependtext seemingly didn't
  work at all on empty pages in the MediaWiki namespace, because
  $this->getTitle() was being used in place of $titleObj.
* Negative undo/undoafter were not rejected in a correct fashion.
* If a logged-in user who was not allowed to upload images tried to
  create an image redirect, the error message used a nonexistent key.

I also replaced assertEquals with assertSame.

I also removed a bit of clearly dead code.  This includes a "break"
following dieStatus().  If we actually want this break so that nobody
adds a case after the default and then removes the dieStatus() so the
switch incorrectly falls through, it could be re-added with
@codeCoverageIgnore.

I put the fixes in the same commit as the test changes because I like to
keep fixes together with the tests for those fixes.

All code now shows up as covered locally, except for one line that seems
to be a PHPUnit bug.

Change-Id: I9375bc5f40268fd681a2d447c66a03f40b23390a
2018-03-28 15:33:24 +03:00
..
content Get ~100% test coverage for ApiEditPage.php and fix a couple of bugs 2018-03-28 15:33:24 +03:00
filebackend Improve some parameter docs 2017-09-10 20:32:31 +02:00
filerepo Migrate callers to new MWFileProps::getPropsFromPath() method 2016-09-22 00:33:46 +00:00
media Remove test code that depends on extension 2017-08-13 12:04:37 -04:00
session Convert all array() syntax to [] 2016-02-17 01:33:00 -08:00
MockChangesListFilter.php RC Filters: Detect filters conflicts to by-pass db query 2017-04-18 22:49:58 -04:00
MockChangesListFilterGroup.php RCFilters: define consistent interface in ChangesListFilterGroup 2017-10-18 12:44:51 -07:00
MockWebRequest.php Make phpcs pass 2017-08-11 16:22:42 +02:00