Skip to content

Commit 154e32f

Browse files
stayallivecleptric
authored andcommitted
Fix tests
1 parent ed237a1 commit 154e32f

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

src/Sentry/Laravel/EventHandler.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use Laravel\Sanctum\Events as Sanctum;
1919
use RuntimeException;
2020
use Sentry\Breadcrumb;
21+
use Sentry\Laravel\Tracing\Middleware;
2122
use Sentry\SentrySdk;
2223
use Sentry\State\Scope;
2324
use Symfony\Component\Console\Input\ArgvInput;

src/Sentry/Laravel/Features/HttpClientIntegration.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public function onBoot(Dispatcher $events, Factory $factory): void
3838
$events->listen(ResponseReceived::class, [$this, 'handleResponseReceivedHandlerForTracing']);
3939
$events->listen(ConnectionFailed::class, [$this, 'handleConnectionFailedHandlerForTracing']);
4040

41+
// The `globalRequestMiddleware` functionality was introduced in Laravel 10.14
4142
if (method_exists($factory, 'globalRequestMiddleware')) {
4243
$factory->globalRequestMiddleware([$this, 'attachTracingHeadersToRequest']);
4344
}

test/Sentry/Features/HttpClientIntegrationTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function testHttpClientBreadcrumbIsNotRecordedWhenDisabled(): void
6464
new Response(new PsrResponse(200, [], 'response'))
6565
));
6666

67-
$this->assertEmpty($this->getCurrentBreadcrumbs());
67+
$this->assertEmpty($this->getCurrentSentryBreadcrumbs());
6868
}
6969

7070
public function testHttpClientSpanIsRecorded(): void
@@ -128,6 +128,10 @@ public function testHttpClientSpanIsNotRecordedWhenDisabled(): void
128128

129129
public function testHttpClientRequestTracingHeadersAreAttached(): void
130130
{
131+
if (!method_exists(Http::class, 'globalRequestMiddleware')) {
132+
$this->markTestSkipped('The `globalRequestMiddleware` functionality we rely on was introduced in Laravel 10.14');
133+
}
134+
131135
$this->resetApplicationWithConfig([
132136
'sentry.trace_propagation_targets' => ['example.com'],
133137
]);

0 commit comments

Comments
 (0)