OpenTelemetry PHP

MapParserTest extends TestCase
in package

Attributes
#[CoversClass]
\OpenTelemetry\SDK\Common\Configuration\Parser\MapParser::class

Table of Contents

Constants

INVALID_VALUES  = ['string' => ['foobar'], 'no equals' => ['foo=bar,barbaz']]
MAP_VALUES  = ['empty' => ['', []], 'single pair' => ['foo=bar', ['foo' => 'bar']], 'multiple pairs' => ['foo=bar,bar=baz,baz=foo', ['foo' => 'bar', 'bar' => 'baz', 'baz' => 'foo']], 'multiple items with spaces' => ['foo =bar,bar= baz, baz = foo', ['foo' => 'bar', 'bar' => 'baz', 'baz' => 'foo']], 'base64 encoded value is split correctly and trailing equals sign is kept in value' => ['Authorization=Basic 1234abc=,bar=baz', ['Authorization' => 'Basic 1234abc=', 'bar' => 'baz']]]

Methods

invalidValueProvider()  : array<string|int, mixed>
mapValueProvider()  : array<string|int, mixed>
test_invalid_values_throw_exception()  : void
test_map_values_return_array()  : void

Constants

INVALID_VALUES

private mixed INVALID_VALUES = ['string' => ['foobar'], 'no equals' => ['foo=bar,barbaz']]

MAP_VALUES

private mixed MAP_VALUES = ['empty' => ['', []], 'single pair' => ['foo=bar', ['foo' => 'bar']], 'multiple pairs' => ['foo=bar,bar=baz,baz=foo', ['foo' => 'bar', 'bar' => 'baz', 'baz' => 'foo']], 'multiple items with spaces' => ['foo =bar,bar= baz, baz = foo', ['foo' => 'bar', 'bar' => 'baz', 'baz' => 'foo']], 'base64 encoded value is split correctly and trailing equals sign is kept in value' => ['Authorization=Basic 1234abc=,bar=baz', ['Authorization' => 'Basic 1234abc=', 'bar' => 'baz']]]

Methods

invalidValueProvider()

public static invalidValueProvider() : array<string|int, mixed>
Return values
array<string|int, mixed>

mapValueProvider()

public static mapValueProvider() : array<string|int, mixed>
Return values
array<string|int, mixed>

test_invalid_values_throw_exception()

public test_invalid_values_throw_exception(string $value) : void
Parameters
$value : string
Attributes
#[DataProvider]
'invalidValueProvider'

test_map_values_return_array()

public test_map_values_return_array(string $value, array<string|int, mixed> $expected) : void
Parameters
$value : string
$expected : array<string|int, mixed>
Attributes
#[DataProvider]
'mapValueProvider'

        
On this page

Search results