BooleanParserTest
extends TestCase
-
#[CoversClass]
-
\OpenTelemetry\SDK\Common\Configuration\Parser\BooleanParser::class
Table of Contents
Constants
-
DISALLOWED_BOOLEAN_VALUES
= [['ON'], ['on'], ['On'], ['1'], ['OFF'], ['off'], ['Off'], ['0']]
-
FALSY_VALUES
= ['bool uppercase' => ['FALSE'], 'bool lowercase' => ['false'], 'bool mixed case' => ['False']]
-
NON_BOOLEAN_VALUES
= ['string' => ['Foo'], 'int' => ['42'], 'float' => ['0.5']]
-
TRUTHY_VALUES
= ['bool uppercase' => ['TRUE'], 'bool lowercase' => ['true'], 'bool mixed case' => ['True']]
Methods
-
disallowedBooleanProvider()
: array<string|int, mixed>
-
falsyValueProvider()
: array<string|int, mixed>
-
nonBooleanValueProvider()
: array<string|int, mixed>
-
test_disallowed_boolean_type_values_throw_exception()
: void
-
test_falsy_values_return_false()
: void
-
test_non_boolean_values_throw_exception()
: void
-
test_truthy_values_return_true()
: void
-
truthyValueProvider()
: array<string|int, mixed>
DISALLOWED_BOOLEAN_VALUES
private
mixed
DISALLOWED_BOOLEAN_VALUES
= [['ON'], ['on'], ['On'], ['1'], ['OFF'], ['off'], ['Off'], ['0']]
FALSY_VALUES
private
mixed
FALSY_VALUES
= ['bool uppercase' => ['FALSE'], 'bool lowercase' => ['false'], 'bool mixed case' => ['False']]
NON_BOOLEAN_VALUES
private
mixed
NON_BOOLEAN_VALUES
= ['string' => ['Foo'], 'int' => ['42'], 'float' => ['0.5']]
TRUTHY_VALUES
private
mixed
TRUTHY_VALUES
= ['bool uppercase' => ['TRUE'], 'bool lowercase' => ['true'], 'bool mixed case' => ['True']]
disallowedBooleanProvider()
public
static disallowedBooleanProvider() : array<string|int, mixed>
Return values
array<string|int, mixed>
falsyValueProvider()
public
static falsyValueProvider() : array<string|int, mixed>
Return values
array<string|int, mixed>
nonBooleanValueProvider()
public
static nonBooleanValueProvider() : array<string|int, mixed>
Return values
array<string|int, mixed>
test_disallowed_boolean_type_values_throw_exception()
public
test_disallowed_boolean_type_values_throw_exception(string $value) : void
Parameters
-
$value
: string
-
-
#[DataProvider]
-
'disallowedBooleanProvider'
test_falsy_values_return_false()
public
test_falsy_values_return_false(string $value) : void
Parameters
-
$value
: string
-
-
#[DataProvider]
-
'falsyValueProvider'
test_non_boolean_values_throw_exception()
public
test_non_boolean_values_throw_exception(string $value) : void
Parameters
-
$value
: string
-
-
#[DataProvider]
-
'nonBooleanValueProvider'
test_truthy_values_return_true()
public
test_truthy_values_return_true(string $value) : void
Parameters
-
$value
: string
-
-
#[DataProvider]
-
'truthyValueProvider'
truthyValueProvider()
public
static truthyValueProvider() : array<string|int, mixed>
Return values
array<string|int, mixed>