Skip to content

Commit

Permalink
Remove the PHPUnit --verbose option from Moodle >= 5.0 runs
Browse files Browse the repository at this point in the history
Also, within GH workflows, emit a warning about it being removed.
  • Loading branch information
stronk7 committed Jan 28, 2025
1 parent bafaf16 commit b73c012
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/Command/PHPUnitCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,19 @@ private function resolveOptions(InputInterface $input): array
];
}
if ($input->getOption('verbose')) {
$options[] = [
'--verbose',
];
if ($this->moodle->getBranch() <= 405) { // Only available with PHPUnit <= 9.x (Moodle <= 4.5).
$options[] = [
'--verbose',
];
} else {
// @codeCoverageIgnoreStart
if (!defined('PHPUNIT_TEST')) { // Only show deprecation warnings in non-test environments.
if (getenv('GITHUB_ACTIONS')) { // Only show deprecation annotations in GitHub Actions.
echo '::warning title=Deprecated PHPUnit --verbose option::The --verbose option was removed for ' .
' PHPUnit 10, so it will be ignored by this run (Moodle >= 5.0)' . PHP_EOL;
}
}
// @codeCoverageIgnoreEnd
}
foreach (['fail-on-incomplete', 'fail-on-risky', 'fail-on-skipped', 'fail-on-warning', 'testdox'] as $option) {
if ($input->getOption($option)) {
Expand Down

0 comments on commit b73c012

Please sign in to comment.