Skip to content

Commit

Permalink
tests: if deprecation is enabled, use custom config to avoid logging …
Browse files Browse the repository at this point in the history
…the stacktrace
  • Loading branch information
mfn committed Nov 20, 2024
1 parent 29023af commit 512f241
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,17 @@ protected function getEnvironmentSetUp($app): void
]);

$app['config']->set('app.debug', true);

$deprecationChannel = $app['config']->get('logging.deprecations.channel');

if ($deprecationChannel) {
// By setting `logging.channels.deprecations` here manually we
// override some behaviour in `\Orchestra\Testbench\Bootstrap\HandleExceptions::ensureDeprecationLoggerIsConfigured`
// and avoid enabling the stacktrace
$app['config']->set('logging.channels.deprecations', [
'driver' => $deprecationChannel,
]);
}
}

protected function assertGraphQLSchema($schema): void
Expand Down

0 comments on commit 512f241

Please sign in to comment.