class ReflectionInterfaceParserTest extends TestCase (View source)

Methods

testItCanNotParseUsersEnums()

No description

testEachParseReturnsItsOwnInterfaceModel()

The declared return type already guarantees the model class, so asserting instanceof could never fail. What is not type-guaranteed — and would be a real regression if a parser ever memoised its result — is that each call yields its own model rather than a shared, mutable one.

testItCanParseName()

No description

testItCanParseNamespace()

No description

testItCanParseRootNamespace()

No description

testItCanParseId()

No description

testItCanParseMethods()

No description

testItCanParseConstants()

No description

testItDeclaresMethodsAndConstantsAsNonNullableArrays()

The : array declarations on PHPClassLikeObject are what make a null return impossible, and every assertNotNull() on these getters in this file leans on them. Pin the declarations themselves: widening either to ?array would reintroduce the null case while the behavioural tests below still passed, and callers doing foreach($x->getMethods()) would start breaking at runtime instead.

testItParsesParentInterfaces()

Interface inheritance was dropped on the reflection side: parse() never touched getInterfaces(), so getParentInterfaces() was [] for every reflected interface, which made ClassHierarchyResolver::resolveInterface() a no-op on the reflection storage.

Details

testItCanParseInternalInterface()

No description

testItCanNotParseUserInterface()

No description

testItCanNotParseInternalNonInterface()

No description

testItCanNotParseUsersNonInterface()

No description

testItCanNotParseInternalEnums()

No description

testItCanNotParseUsersEnums()

No description

testEachParseReturnsItsOwnInterfaceModel()

The declared return type already guarantees the model class, so asserting instanceof could never fail. What is not type-guaranteed — and would be a real regression if a parser ever memoised its result — is that each call yields its own model rather than a shared, mutable one.

testItCanParseName()

No description

testItCanParseNamespace()

No description

testItCanParseRootNamespace()

No description

testItCanParseId()

No description

testItCanParseIdWithRootNamespace()

No description

testItCanParseMethods()

No description

testItReturnsCorrectInstanceOfParsedMethods()

No description

testItReturnsEmptyArrayIfMethodsCanNotBeRead()

No description

testItReturnsEmptyArrayIfNoMethods()

No description

testItReturnsActualParsedMethods()

No description

testItReturnsAllActuallyParsedMethods()

No description

testItCanParseConstants()

No description

testItCanParseInterfaceMethods()

No description

testItDeclaresMethodsAndConstantsAsNonNullableArrays()

The : array declarations on PHPClassLikeObject are what make a null return impossible, and every assertNotNull() on these getters in this file leans on them. Pin the declarations themselves: widening either to ?array would reintroduce the null case while the behavioural tests below still passed, and callers doing foreach($x->getMethods()) would start breaking at runtime instead.

testItReturnsEmptyArrayIfNoConstants()

No description

testItCanParseInterfaceConstants()

No description

testItParsesParentInterfaces()

Interface inheritance was dropped on the reflection side: parse() never touched getInterfaces(), so getParentInterfaces() was [] for every reflected interface, which made ClassHierarchyResolver::resolveInterface() a no-op on the reflection storage.

The ids are asserted, not just the count: ClassHierarchyResolver matches on the FQN, so a parent stored under a bare name would resolve to the wrong (global) interface.

testItKeepsParentInterfacesEmptyForARootInterface()

No description