Skip to content

Commit 8166b0b

Browse files
committed
Do not test the base SDK
1 parent b4dc2ab commit 8166b0b

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

tests/Tracing/HttpClient/TraceableHttpClientTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ public function testRequest(): void
9292
$this->assertSame(200, $response->getStatusCode());
9393
$this->assertSame('GET', $response->getInfo('http_method'));
9494
$this->assertSame('https://username:[email protected]/test-page?foo=bar#baz', $response->getInfo('url'));
95-
$this->assertSame(['sentry-trace: ' . $spans[1]->toTraceparent()], $mockResponse->getRequestOptions()['normalized_headers']['sentry-trace']);
96-
$this->assertSame(['traceparent: ' . $spans[1]->toW3CTraceparent()], $mockResponse->getRequestOptions()['normalized_headers']['traceparent']);
97-
$this->assertSame(['baggage: ' . $transaction->toBaggage()], $mockResponse->getRequestOptions()['normalized_headers']['baggage']);
95+
$this->assertSame([\sprintf('sentry-trace: %s', $spans[1]->toTraceparent())], $mockResponse->getRequestOptions()['normalized_headers']['sentry-trace']);
96+
$this->assertSame([\sprintf('traceparent: %s', $spans[1]->toW3CTraceparent())], $mockResponse->getRequestOptions()['normalized_headers']['traceparent']);
97+
$this->assertSame([\sprintf('baggage: %s', $transaction->toBaggage())], $mockResponse->getRequestOptions()['normalized_headers']['baggage']);
9898
$this->assertNotNull($transaction->getSpanRecorder());
9999

100100
$spans = $transaction->getSpanRecorder()->getSpans();
@@ -199,9 +199,9 @@ public function testRequestDoesContainsTracingHeadersWithoutTransaction(): void
199199
$this->assertSame(200, $response->getStatusCode());
200200
$this->assertSame('POST', $response->getInfo('http_method'));
201201
$this->assertSame('https://www.example.com/test-page', $response->getInfo('url'));
202-
$this->assertSame(['sentry-trace: 566e3688a61d4bc888951642d6f14a19-566e3688a61d4bc8'], $mockResponse->getRequestOptions()['normalized_headers']['sentry-trace']);
203-
$this->assertSame(['traceparent: 00-566e3688a61d4bc888951642d6f14a19-566e3688a61d4bc8-00'], $mockResponse->getRequestOptions()['normalized_headers']['traceparent']);
204-
$this->assertSame(['baggage: sentry-trace_id=566e3688a61d4bc888951642d6f14a19,sentry-public_key=public,sentry-release=1.0.0,sentry-environment=test'], $mockResponse->getRequestOptions()['normalized_headers']['baggage']);
202+
$this->assertSame([\sprintf('sentry-trace: %s', $propagationContext->toTraceparent())], $mockResponse->getRequestOptions()['normalized_headers']['sentry-trace']);
203+
$this->assertSame([\sprintf('traceparent: %s', $propagationContext->toW3CTraceparent())], $mockResponse->getRequestOptions()['normalized_headers']['traceparent']);
204+
$this->assertSame([\sprintf('baggage: %s', $propagationContext->toBaggage())], $mockResponse->getRequestOptions()['normalized_headers']['baggage']);
205205
}
206206

207207
public function testRequestSetsUnknownErrorAsSpanStatusIfResponseStatusCodeIsUnavailable(): void

tests/Twig/SentryExtensionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public function testBaggageMetaFunctionWithNoActiveSpan(): void
138138

139139
SentrySdk::setCurrentHub($hub);
140140

141-
$this->assertSame('<meta name="baggage" content="sentry-trace_id=566e3688a61d4bc888951642d6f14a19,sentry-sample_rate=1,sentry-release=1.0.0,sentry-environment=development" />', $environment->render('foo.twig'));
141+
$this->assertSame(\sprintf('<meta name="baggage" content="%s" />', $propagationContext->toBaggage()), $environment->render('foo.twig'));
142142
}
143143

144144
public function testBaggageMetaFunctionWithActiveSpan(): void
@@ -164,7 +164,7 @@ public function testBaggageMetaFunctionWithActiveSpan(): void
164164

165165
$hub->setSpan($transaction);
166166

167-
$this->assertSame('<meta name="baggage" content="sentry-trace_id=a3c01c41d7b94b90aee23edac90f4319,sentry-transaction=%3Cunlabeled%20transaction%3E,sentry-release=1.0.0,sentry-environment=development" />', $environment->render('foo.twig'));
167+
$this->assertSame(\sprintf('<meta name="baggage" content="%s" />', $transaction->toBaggage()), $environment->render('foo.twig'));
168168
}
169169

170170
private static function isTwigBundlePackageInstalled(): bool

0 commit comments

Comments
 (0)