Skip to content

Commit 652c4fd

Browse files
ShaneOHsebastianbergmann
authored andcommitted
add stack trace to bootstrap error message
1 parent d4609a3 commit 652c4fd

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/TextUI/Command.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,10 +567,12 @@ protected function handleBootstrap(string $filename): void
567567

568568
$this->exitWithErrorMessage(
569569
sprintf(
570-
'Error in bootstrap script: %s:%s%s',
570+
'Error in bootstrap script: %s:%s%s%s%s',
571571
get_class($t),
572572
PHP_EOL,
573-
$t->getMessage()
573+
$t->getMessage(),
574+
PHP_EOL,
575+
$t->getTraceAsString()
574576
)
575577
);
576578
}

tests/end-to-end/regression/GitHub/4620.phpt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
--TEST--
2-
https://github.com/sebastianbergmann/phpunit/issues/4620
2+
GH-4620 GH-4877
33
--FILE--
44
<?php declare(strict_types=1);
55

@@ -17,3 +17,4 @@ PHPUnit %s #StandWithUkraine
1717

1818
Error in bootstrap script: PHPUnit\TestFixture\MyException:
1919
Big boom. Big bada boom.
20+
%a

0 commit comments

Comments
 (0)