Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add stack trace to bootstrap error message #4878

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/TextUI/Command.php
Expand Up @@ -567,10 +567,12 @@ protected function handleBootstrap(string $filename): void

$this->exitWithErrorMessage(
sprintf(
'Error in bootstrap script: %s:%s%s',
'Error in bootstrap script: %s:%s%s%s%s',
get_class($t),
PHP_EOL,
$t->getMessage()
$t->getMessage(),
PHP_EOL,
$t->getTraceAsString()
)
);
}
Expand Down
3 changes: 2 additions & 1 deletion tests/end-to-end/regression/GitHub/4620.phpt
@@ -1,5 +1,5 @@
--TEST--
https://github.com/sebastianbergmann/phpunit/issues/4620
GH-4620 GH-4877
--FILE--
<?php declare(strict_types=1);

Expand All @@ -17,3 +17,4 @@ PHPUnit %s by Sebastian Bergmann and contributors.

Error in bootstrap script: PHPUnit\TestFixture\MyException:
Big boom. Big bada boom.
%a