@@ -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
0 commit comments