diff options
Diffstat (limited to 'vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/SpanContextTest.php')
-rw-r--r-- | vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/SpanContextTest.php | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/SpanContextTest.php b/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/SpanContextTest.php new file mode 100644 index 000000000..998061088 --- /dev/null +++ b/vendor/jonahgeorge/jaeger-client-php/tests/Jaeger/SpanContextTest.php @@ -0,0 +1,37 @@ +<?php + +namespace Jaeger\Tests; + +use Jaeger\SpanContext; +use PHPUnit\Framework\TestCase; + +class SpanContextTest extends TestCase +{ + public function testIsDebugIdContainerOnly() + { + $ctx = new SpanContext(null, null, null, null, null, 'value1'); + $this->assertTrue($ctx->isDebugIdContainerOnly()); + $this->assertEquals($ctx->getDebugId(), 'value1'); + + $ctx = new SpanContext(1, 2, 3, 1); + $this->assertFalse($ctx->isDebugIdContainerOnly()); + } + + /** + * @dataProvider contextDataProvider + */ + public function testBaggageInit($traceId, $spanId, $parentId, $flags, $baggage, $expected) + { + $ctx = new SpanContext($traceId, $spanId, $parentId, $flags, $baggage); + $this->assertEquals($expected, $ctx->getBaggage()); + } + + public function contextDataProvider() + { + return [ + [null, null, null, null, [], []], + [null, null, null, null, null, []], + [null, null, null, null, ['key' => 'val'], ['key' => 'val']], + ]; + } +} |