class InheritDocVersionResolverTest extends TestCase (View source)

Tests for @inheritDoc since-version inheritance.

This resolver mutates entity metadata in place and had no direct test, while its sibling ClassHierarchyResolver — which it depends on having run first — does. The cases below cover each parent-walking axis (implemented interfaces, parent interfaces, parent class chain), the guards that decide whether a method is a candidate at all, and the cycle detection.

Methods

void
setUp()

No description

testExistingSinceVersionIsNotOverwritten()

An explicit @since already present must never be overwritten by an inherited one.

testMethodWithoutInheritDocIsLeftAlone()

Without an @inheritDoc tag there is nothing to inherit, even when a parent has a version.

testInheritDocTagIsMatchedCaseInsensitively()

The tag is matched case-insensitively — @inheritdoc and @inheritDoc both count.

testUnrelatedParentMethodDoesNotSupplyAVersion()

Only a parent method of the same name supplies the version.

testParentWithoutAnExplicitSinceSuppliesNothing()

A parent that declares the method but has no @since of its own supplies nothing.

testInterfacesAreResolvedBeforeClassesSoChainedInheritanceWorks()

Interfaces are resolved before classes, so a class inheriting through an interface that itself inherited its version still sees a resolved value. Guards the ordering in resolve().

testCyclicInterfaceGraphTerminates()

A cyclic parent graph must terminate rather than recurse forever. Constructed directly because ClassHierarchyResolver would not normally produce one.

testSelfReferencingParentClassTerminates()

A self-referencing parent class must also terminate.

testImplementedInterfaceIsCheckedBeforeTheParentClass()

An implemented interface is preferred over the parent class when both could supply it.

Details

protected void setUp()

No description

Return Value

void

testVersionIsInheritedFromAnImplementedInterface()

No description

testVersionIsInheritedFromTheParentClassChain()

No description

testVersionIsInheritedFromAParentInterface()

No description

testEnumsInheritFromTheirImplementedInterfaces()

No description

testExistingSinceVersionIsNotOverwritten()

An explicit @since already present must never be overwritten by an inherited one.

testMethodWithoutInheritDocIsLeftAlone()

Without an @inheritDoc tag there is nothing to inherit, even when a parent has a version.

testMethodWithNoPhpDocAtAllIsLeftAlone()

No description

testInheritDocTagIsMatchedCaseInsensitively()

The tag is matched case-insensitively — @inheritdoc and @inheritDoc both count.

testUnrelatedParentMethodDoesNotSupplyAVersion()

Only a parent method of the same name supplies the version.

testParentWithoutAnExplicitSinceSuppliesNothing()

A parent that declares the method but has no @since of its own supplies nothing.

testInterfacesAreResolvedBeforeClassesSoChainedInheritanceWorks()

Interfaces are resolved before classes, so a class inheriting through an interface that itself inherited its version still sees a resolved value. Guards the ordering in resolve().

testCyclicInterfaceGraphTerminates()

A cyclic parent graph must terminate rather than recurse forever. Constructed directly because ClassHierarchyResolver would not normally produce one.

testSelfReferencingParentClassTerminates()

A self-referencing parent class must also terminate.

testImplementedInterfaceIsCheckedBeforeTheParentClass()

An implemented interface is preferred over the parent class when both could supply it.

testResolveToleratesEmptyInput()

No description