44
55namespace OpenTelemetry \Tests \Instrumentation \Symfony \tests \Integration ;
66
7+ use OpenTelemetry \Contrib \Propagation \ServerTiming \ServerTimingPropagator ;
78use OpenTelemetry \Contrib \Propagation \TraceResponse \TraceResponsePropagator ;
89use OpenTelemetry \SemConv \TraceAttributes ;
910use Symfony \Component \EventDispatcher \EventDispatcher ;
@@ -62,6 +63,12 @@ public function test_http_kernel_handle_attributes(): void
6263 $ response ->headers ->all (),
6364 'traceresponse header is present if TraceResponsePropagator is present '
6465 );
66+
67+ $ this ->assertArrayHasKey (
68+ ServerTimingPropagator::SERVER_TIMING ,
69+ $ response ->headers ->all (),
70+ 'server-timings header is present if ServerTimingPropagator is present '
71+ );
6572 }
6673
6774 public function test_http_kernel_handle_stream_response (): void
@@ -81,6 +88,12 @@ public function test_http_kernel_handle_stream_response(): void
8188 $ response ->headers ->all (),
8289 'traceresponse header is present if TraceResponsePropagator is present '
8390 );
91+
92+ $ this ->assertArrayHasKey (
93+ ServerTimingPropagator::SERVER_TIMING ,
94+ $ response ->headers ->all (),
95+ 'server-timings header is present if ServerTimingPropagator is present '
96+ );
8497 }
8598
8699 public function test_http_kernel_handle_binary_file_response (): void
@@ -97,6 +110,12 @@ public function test_http_kernel_handle_binary_file_response(): void
97110 $ response ->headers ->all (),
98111 'traceresponse header is present if TraceResponsePropagator is present '
99112 );
113+
114+ $ this ->assertArrayHasKey (
115+ ServerTimingPropagator::SERVER_TIMING ,
116+ $ response ->headers ->all (),
117+ 'server-timings header is present if ServerTimingPropagator is present '
118+ );
100119 }
101120
102121 public function test_http_kernel_handle_with_empty_route (): void
@@ -115,6 +134,12 @@ public function test_http_kernel_handle_with_empty_route(): void
115134 $ response ->headers ->all (),
116135 'traceresponse header is present if TraceResponsePropagator is present '
117136 );
137+
138+ $ this ->assertArrayHasKey (
139+ ServerTimingPropagator::SERVER_TIMING ,
140+ $ response ->headers ->all (),
141+ 'server-timings header is present if ServerTimingPropagator is present '
142+ );
118143 }
119144
120145 public function test_http_kernel_handle_without_route (): void
@@ -131,6 +156,12 @@ public function test_http_kernel_handle_without_route(): void
131156 $ response ->headers ->all (),
132157 'traceresponse header is present if TraceResponsePropagator is present '
133158 );
159+
160+ $ this ->assertArrayHasKey (
161+ ServerTimingPropagator::SERVER_TIMING ,
162+ $ response ->headers ->all (),
163+ 'server-timings header is present if ServerTimingPropagator is present '
164+ );
134165 }
135166
136167 private function getHttpKernel (EventDispatcherInterface $ eventDispatcher , $ controller = null , RequestStack $ requestStack = null , array $ arguments = []): HttpKernel
0 commit comments