class StubConstantDefaultValueTest extends TestCase (View source)

Covers the stub-sourced fallback used when a parameter default references a constant that the host runtime cannot resolve (e.g. ext-intl not loaded).

Traits

Shared utility methods for serializers: type parsing and JSON-safe conversion.

Methods

toJsonSafe($value)

Convert value to JSON-safe format, filtering out resources and closures

parseType(string|null $typeStr)

Parse a type string back into the correct type object.

void
setUp()

No description

void
tearDown()

No description

void
mixed
expose(mixed $value)

No description

Details

protected toJsonSafe($value)

Convert value to JSON-safe format, filtering out resources and closures

Parameters

$value

protected StandaloneType|UnionType|NullableType|NoType|IntersectionType parseType(string|null $typeStr)

Parse a type string back into the correct type object.

Rules: "" -> NoType "A&B" -> IntersectionType "(A&B)" -> IntersectionType (parenthesised pure intersection) "A|null" -> NullableType (exactly 2 parts, one is "null") "int|(A&B)|..." -> UnionType with IntersectionType member (DNF) "A|B|..." -> UnionType "?A" -> NullableType "A" -> StandaloneType

Parameters

string|null $typeStr

Return Value

StandaloneType|UnionType|NullableType|NoType|IntersectionType

protected void setUp()

No description

Return Value

void

protected void tearDown()

No description

Return Value

void

void testClassConstantDefaultResolvesFromRegistryWhenRuntimeCannot()

No description

Return Value

void

void testGlobalConstantDefaultResolvesFromRegistryWhenRuntimeCannot()

No description

Return Value

void

void testStaysNullWhenNeitherRuntimeNorRegistryKnowsTheConstant()

No description

Return Value

void

void testRuntimeResolutionStillWins()

No description

Return Value

void

void testIntlPartsIteratorDefaultIsResolvableAfterParsingIntlStub()

No description

Return Value

void

void testEnumCaseDefaultResolvesToReferenceWhenRuntimeCannot()

No description

Return Value

void

void testEnumCaseReferenceSerializesLikeRuntimeResolvedInstance()

No description

Return Value

void

mixed expose(mixed $value)

No description

Parameters

mixed $value

Return Value

mixed