InterfaceValidatorTest
class InterfaceValidatorTest extends ValidatorTestBase (View source)
Validates that interfaces from reflection exist in stubs and their methods are correct.
Each interface is tested individually as a separate test case, making it easy to identify failures and re-run specific tests.
Methods
Return check descriptors for declarative test registration.
Generic data provider that yields [checkName, entityId, phpVersion] for each entity.
No description
Get entities to test based on the method name.
Get the unique identifier for an entity.
Build a unique test name from method, entity, and version.
Execute a validation check and assert results.
Details
protected void
setUp()
No description
static protected array
getCheckDescriptors()
Return check descriptors for declarative test registration.
Each entry maps a logical check name to a CheckDescriptor.
static iterable
entityProvider()
Generic data provider that yields [checkName, entityId, phpVersion] for each entity.
When getCheckDescriptors() returns entries, iterates those descriptors. Otherwise falls back to scanning methods for PhpVersionRange attributes.
void
testEntity(string $methodName, string $entityId, string $phpVersion)
No description
static protected iterable
getEntitiesForMethod(string $methodName, StubDataQueryInterface $reflection)
Get entities to test based on the method name.
Subclasses should override to return specific entity types.
static protected string
getEntityId(mixed $entity)
Get the unique identifier for an entity.
static protected string
buildTestName(string $methodName, string $entityId, string $phpVersion)
Build a unique test name from method, entity, and version.
protected void
executeCheck(CheckInterface $check, string $entityId, string $phpVersion, string|null $customMessage = null)
Execute a validation check and assert results.