Adds --profile

This commit is contained in:
Nuno Maduro
2022-09-16 19:11:59 +01:00
parent 3d5271f512
commit b0b83505af
2 changed files with 25 additions and 19 deletions

View File

@ -78,6 +78,24 @@ final class Coverage implements AddsOutput, HandlesArguments
$this->coverage = true;
$originals[] = '--coverage-php';
$originals[] = \Pest\Support\Coverage::getPath();
if (! \Pest\Support\Coverage::isAvailable()) {
if (\Pest\Support\Coverage::usingXdebug()) {
$this->output->writeln([
'',
" <fg=default;bg=red;options=bold> ERROR </> Unable to get coverage using Xdebug. Did you set <href=https://xdebug.org/docs/code_coverage#mode>Xdebug's coverage mode</>?</>",
'',
]);
} else {
$this->output->writeln([
'',
' <fg=default;bg=red;options=bold> ERROR </> No code coverage driver is available.</>',
'',
]);
}
exit(1);
}
}
if ($input->getOption(self::MIN_OPTION) !== null) {
@ -87,24 +105,6 @@ final class Coverage implements AddsOutput, HandlesArguments
$this->coverageMin = (float) $minOption;
}
if (! \Pest\Support\Coverage::isAvailable()) {
if (\Pest\Support\Coverage::usingXdebug()) {
$this->output->writeln([
'',
" <fg=default;bg=red;options=bold> ERROR </> Unable to get coverage using Xdebug. Did you set <href=https://xdebug.org/docs/code_coverage#mode>Xdebug's coverage mode</>?</>",
'',
]);
} else {
$this->output->writeln([
'',
' <fg=default;bg=red;options=bold> ERROR </> No code coverage driver is available.</>',
'',
]);
}
exit(1);
}
return $originals;
}