File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
src/Instrumentation/PDO/tests/Unit Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ use PHPUnit \Framework \TestCase ;
4+ use OpenTelemetry \Contrib \Instrumentation \PDO \Opentelemetry ;
5+
6+ class OpentelemetryTest extends TestCase
7+ {
8+ public function testGetTraceContextValuesReturnsArray ()
9+ {
10+ $ result = Opentelemetry::getTraceContextValues ();
11+ $ this ->assertIsArray ($ result );
12+ }
13+
14+ public function testGetServiceNameValuesReturnsArray ()
15+ {
16+ $ result = Opentelemetry::getServiceNameValues ();
17+ $ this ->assertIsArray ($ result );
18+ }
19+
20+ public function testGetServiceNameValuesHandlesMissingClass ()
21+ {
22+ // Temporarily ensure the class does not exist
23+ if (class_exists ('OpenTelemetry\Contrib\Propagation\ServiceName\ServiceNamePropagator ' )) {
24+ $ this ->markTestSkipped ('ServiceNamePropagator class exists, cannot test missing class branch. ' );
25+ }
26+ $ result = Opentelemetry::getServiceNameValues ();
27+ $ this ->assertIsArray ($ result );
28+ $ this ->assertEmpty ($ result );
29+ }
30+ }
You can’t perform that action at this time.
0 commit comments