8000 Added nunomaduro/collision for better stack traces · Codeception/Codeception@bb74535 · GitHub
[go: up one dir, main page]

Skip to content

Commit bb74535

Browse files
committed
Added nunomaduro/collision for better stack traces
1 parent 8d6b2dc commit bb74535

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
"symfony/yaml": ">=4.4 <6.0",
2929
"symfony/css-selector": ">=4.4 <6.0",
3030
"behat/gherkin": "^4.6.2",
31-
"codeception/stub": "^3.7"
31+
"codeception/stub": "^3.7",
32+
"nunomaduro/collision": "^5.1"
3233
},
3334
"require-dev": {
3435
"vlucas/phpdotenv": "^4.0 | ^5.0",

src/Codeception/Subscriber/Console.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@
1818
use Codeception\Test\Interfaces\ScenarioDriven;
1919
use Codeception\TestInterface;
2020
use Codeception\Util\Debug;
21+
use NunoMaduro\Collision\Writer;
2122
use Symfony\Component\Console\Output\OutputInterface;
2223
use Symfony\Component\Console\Formatter\OutputFormatter;
2324
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
25+
use Whoops\Exception\Inspector;
2426

2527
class Console implements EventSubscriberInterface
2628
{
@@ -465,6 +467,20 @@ public function printExceptionTrace($e)
465467
return;
466468
}
467469

470+
$writer = (new Writer())->setOutput($this->output);
471+
$inspector = new Inspector($e);
472+
473+
$writer->ignoreFilesIn([
474+
'/vendor\/codeception\/',
475+
'/vendor\/phpunit\/phpunit\/src/',
476+
'/vendor\/mockery\/mockery/',
477+
'/vendor\/laravel\/framework\/src\/Illuminate\/Testing/',
478+
'/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/Testing/',
479+
]);
480+
481+
$writer->showTrace(false);
482+
$writer->write($inspector);
483+
468484
if ($this->rawStackTrace) {
469485
$this->message(OutputFormatter::escape(\PHPUnit\Util\Filter::getFilteredStacktrace($e, true, false)))->writeln();
470486

0 commit comments

Comments
 (0)
0