MDL-67673 phpunit: Remove the rerun hint on failed test cases
commit0ab106f41ce98f31c404a2f1b9c749fdaa38108a
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Wed, 7 Oct 2020 18:41:44 +0000 (7 20:41 +0200)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Wed, 21 Oct 2020 10:46:05 +0000 (21 12:46 +0200)
tree89ed923b5f38442a1adf1f5ce29587d19c861f8e
parent9f82c9aece89ef3667dc81e0e740c1b72d9b7aea
MDL-67673 phpunit: Remove the rerun hint on failed test cases

That custom printer was using some hacks to be able to intercept
configuration switches, reflection and other tricks to be able to
print the:

To re-run:
 vendor/bin/phpunit --verbose "core_setuplib_testcase" lib/tests/setuplib_test.php

line on every failed/exceptional/skipped test. After some internal
discussion it was agreed that the normal phpunit output:

1) core_setuplib_testcase::test_localcachedir
Time is lower that allowed start value
Failed asserting that 1601976686 is equal to 1601976687 or is greater than 1601976687.

/var/www/html/lib/phpunit/classes/advanced_testcase.php:446
/var/www/html/lib/tests/setuplib_test.php:170
/var/www/html/lib/phpunit/classes/advanced_testcase.php:80

has already all the information at hand about how to rerun a test:

- vendor/bin/phpunit lib/tests/setuplib_test.php
- vendor/bin/phpunit --filter core_setuplib_testcase::test_localcachedir
- vendor/bin/phpunit --filter ::test_localcachedir
- vendor/bin/phpunit --testsuite componentname_testsuite
- vendor/bin/phpunit --config <<compoenent directory>>
- use --cache-result to get failed tests rerun with ease.
- ...

So better, let's use standard phpunit output and done. Also, note that,
with the upgrade to phpunit 8.5, the printer was not working correctly
any more, causing some switches, like --verbose ... to be ignored. Sure
it could have been fixed but, as commented above, no real need for all
that "parapheranlia" to print the rerun information.
lib/phpunit/classes/hint_resultprinter.php [deleted file]
lib/phpunit/lib.php
phpunit.xml.dist