mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 15:57:21 +01:00
feat: improves dump on internal error
This commit is contained in:
@ -70,6 +70,10 @@ final class KernelDump
|
||||
$this->buffer = implode(PHP_EOL, array_slice(explode(PHP_EOL, $this->buffer), 2));
|
||||
}
|
||||
|
||||
if ($this->isInternalError($this->buffer)) {
|
||||
$this->buffer = str_replace('An error occurred inside PHPUnit.', '', $this->buffer);
|
||||
}
|
||||
|
||||
$this->buffer = trim($this->buffer);
|
||||
$this->buffer = rtrim($this->buffer, '.').'.';
|
||||
|
||||
@ -88,4 +92,12 @@ final class KernelDump
|
||||
{
|
||||
return str_contains($output, 'by Sebastian Bergmann and contributors.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the given output contains an opening headline.
|
||||
*/
|
||||
private function isInternalError(string $output): bool
|
||||
{
|
||||
return str_contains($output, 'An error occurred inside PHPUnit.');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user