mirror of
https://github.com/pestphp/pest.git
synced 2026-03-12 10:47:25 +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));
|
$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 = trim($this->buffer);
|
||||||
$this->buffer = rtrim($this->buffer, '.').'.';
|
$this->buffer = rtrim($this->buffer, '.').'.';
|
||||||
|
|
||||||
@ -88,4 +92,12 @@ final class KernelDump
|
|||||||
{
|
{
|
||||||
return str_contains($output, 'by Sebastian Bergmann and contributors.');
|
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