Make phpunit.php less hackish, and install the listener unconditionally
authorTim Starling <tstarling@wikimedia.org>
Mon, 3 Sep 2018 07:02:44 +0000 (17:02 +1000)
committerTim Starling <tstarling@wikimedia.org>
Tue, 4 Sep 2018 05:30:20 +0000 (15:30 +1000)
commit65adc3734846c685e511e22a2846f53e05e9d80c
tree4f4cf44cb0a49bb89aa6096050b8979597e021cd
parent1dc2212bc68c44963d1b32235bd6c80643999fd3
Make phpunit.php less hackish, and install the listener unconditionally

* Instead of rewriting $argv, add a Command subclass called
  MediaWikiPHPUnitCommand which overrides the configuration using the
  stub functions in Command which were provided for that purpose.
* Revert c804a0b5b9be8be9, which added redundant debug output to tests,
  and instead install the MediaWikiPHPUnitTestListener listener
  unconditionally. Deprecate and make non-functional the --debug-tests
  option. If you don't want tests to produce debug output, you can
  always turn the channel off.
* Because I added our listener to the listener array instead of making
  it override the printer, it's no longer necessary to derive from
  PHPUnit\TextUI\ResultPrinter. Instead we derive from BaseTestListener.
  So we don't need to call the (empty) parent methods.
* Remove the --with-phpunitclass feature since it doesn't work with this
  scheme.
* Instead of passing CLI args to MediaWikiTestCase via a public static
  variable, inject it non-statically by overriding the TestRunner and
  TestResult.
* Remove --file, which has been non-functional since my 2016 refactor.

Change-Id: Ibcaf9ca81c8dc63cce6dc6f6fb1fffee19f8804e
tests/common/TestsAutoLoader.php
tests/phpunit/MediaWikiPHPUnitCommand.php [new file with mode: 0644]
tests/phpunit/MediaWikiPHPUnitTestListener.php
tests/phpunit/MediaWikiTestCase.php
tests/phpunit/MediaWikiTestResult.php [new file with mode: 0644]
tests/phpunit/MediaWikiTestRunner.php [new file with mode: 0644]
tests/phpunit/phpunit.php