Skip to content

Commit

Permalink
Skip context tests if contexts are not available
Browse files Browse the repository at this point in the history
  • Loading branch information
stayallive committed Mar 21, 2024
1 parent 0e7db17 commit d2471e6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/Sentry/Integration/LaravelContextIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@

class LaravelContextIntegrationTest extends TestCase
{
protected function setUp(): void
{
if (!class_exists(Context::class)) {
$this->markTestSkipped('Laravel introduced contexts in version 11.');
}

parent::setUp();
}

public function testLaravelContextIntegrationIsRegistered(): void
{
$integration = $this->getSentryHubFromContainer()->getIntegration(LaravelContextIntegration::class);
Expand Down

0 comments on commit d2471e6

Please sign in to comment.