mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
Adds --profile
This commit is contained in:
8
bin/pest
8
bin/pest
@ -19,8 +19,10 @@ use Symfony\Component\Console\Output\OutputInterface;
|
|||||||
foreach ($args as $key => $value) {
|
foreach ($args as $key => $value) {
|
||||||
if (str_contains($value, '--compact')) {
|
if (str_contains($value, '--compact')) {
|
||||||
$_SERVER['COLLISION_PRINTER_COMPACT'] = 'true';
|
$_SERVER['COLLISION_PRINTER_COMPACT'] = 'true';
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
if (str_contains($value, '--profile')) {
|
||||||
|
$_SERVER['COLLISION_PRINTER_PROFILE'] = 'true';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,6 +65,10 @@ use Symfony\Component\Console\Output\OutputInterface;
|
|||||||
if (str_contains($value, '--compact')) {
|
if (str_contains($value, '--compact')) {
|
||||||
unset($args[$key]);
|
unset($args[$key]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (str_contains($value, '--profile')) {
|
||||||
|
unset($args[$key]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$kernel = Kernel::boot();
|
$kernel = Kernel::boot();
|
||||||
|
|||||||
@ -78,6 +78,24 @@ final class Coverage implements AddsOutput, HandlesArguments
|
|||||||
$this->coverage = true;
|
$this->coverage = true;
|
||||||
$originals[] = '--coverage-php';
|
$originals[] = '--coverage-php';
|
||||||
$originals[] = \Pest\Support\Coverage::getPath();
|
$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) {
|
if ($input->getOption(self::MIN_OPTION) !== null) {
|
||||||
@ -87,24 +105,6 @@ final class Coverage implements AddsOutput, HandlesArguments
|
|||||||
$this->coverageMin = (float) $minOption;
|
$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;
|
return $originals;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user