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 56bf1f5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/Command/PHPUnitCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,19 @@ private function resolveOptions(InputInterface $input): array
getcwd() . '/coverage.xml',
];
}
if ($input->getOption('verbose')) {
if ($input->getOption('verbose') && $this->moodle->getBranch() <= 405) { // Only available with PHPUnit <= 9.x.
$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 56bf1f5

Please sign in to comment.