ParentBasedTest
extends MockeryTestCase
-
#[CoversClass]
-
\OpenTelemetry\SDK\Trace\Sampler\ParentBased::class
Table of Contents
Properties
-
$rootSampler
: SamplerInterface
Methods
-
parentContextProvider()
: array<string|int, mixed>
-
setUp()
: void
-
test_get_description()
: void
-
test_parent_based_root_span()
: void
-
test_should_sample_parent_based()
: void
-
createMockSamplerInvokedOnce()
: SamplerInterface
-
createMockSamplerNeverInvoked()
: SamplerInterface
-
createParentContext()
: ContextInterface
parentContextProvider()
public
static parentContextProvider() : array<string|int, mixed>
Return values
array<string|int, mixed>
setUp()
public
setUp() : void
test_get_description()
public
test_get_description() : void
test_parent_based_root_span()
public
test_parent_based_root_span() : void
-
#[Group]
-
'trace-compliance'
test_should_sample_parent_based()
public
test_should_sample_parent_based(mixed $parentContext[, SamplerInterface|null $remoteParentSampled = null ][, SamplerInterface|null $remoteParentNotSampled = null ][, SamplerInterface|null $localParentSampled = null ][, SamplerInterface|null $localParentNotSampled = null ][, int|null $expectedDecision = null ]) : void
Parameters
-
$parentContext
: mixed
-
-
$remoteParentSampled
: SamplerInterface|null
= null
-
-
$remoteParentNotSampled
: SamplerInterface|null
= null
-
-
$localParentSampled
: SamplerInterface|null
= null
-
-
$localParentNotSampled
: SamplerInterface|null
= null
-
-
$expectedDecision
: int|null
= null
-
-
#[DataProvider]
-
'parentContextProvider'
createMockSamplerInvokedOnce()
private
static createMockSamplerInvokedOnce(int $resultDecision) : SamplerInterface
Parameters
-
$resultDecision
: int
-
createMockSamplerNeverInvoked()
private
createMockSamplerNeverInvoked() : SamplerInterface
createParentContext()
private
static createParentContext(bool $sampled, bool $isRemote[, TraceStateInterface|null $traceState = null ]) : ContextInterface
Parameters
-
$sampled
: bool
-
-
$isRemote
: bool
-
-
$traceState
: TraceStateInterface|null
= null
-