classPlanSchemaValidator
final class PlanSchemaValidator
Checks a plan against the tables it names, before anything is generated.
Without this a mistyped column is not an error but a quiet change of meaning: the relation stops linking, and the child's foreign key is filled with a generated value instead of its parent's key. The fixtures look plausible and the test fails, or passes, for reasons that have nothing to do with what it was written to check.
Methods§
public function __construct(private SchemaResolverInterface $schemas)Initializes the collaborators and declared state for this object.
Parameters
$schemas | SchemaResolverInterface |
public function validate(FixturePlan $plan): voidParameters
$plan | FixturePlan |
Throws
GeneratedColumnReferenceException If a relation references a generated columnUnknownPlanColumnException If a relation names a column the table lacksSchemaNotFoundException If a table is not thereTest cases 6
PlanSchemaValidatorTest::aColumnTheTableDoesNotHaveIsRejectedcallsPlanSchemaValidatorTest::testAGeneratedColumnCannotBeLinkedcallsPlanSchemaValidatorTest::testAGeneratedColumnCannotBeWrittenIntoEithercallsPlanSchemaValidatorTest::testATableNamedWithoutAnyRelationIsCheckedToocallsPlanSchemaValidatorTest::testATableTheResolverDoesNotKnowIsRejectedcallsPlanSchemaValidatorTest::testValidateAPlanMatchingTheSchemaPassescalls
Called from 1
Calls 3
- method-call SchemaResolverInterface::resolve() line 36
- method-call EndpointValidator::checkEndpoint() line 40
- new EndpointValidator line 40
Private surface 1§
Implementation details, listed for orientation only.
private SchemaResolverInterface $schemasTest cases 11§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 6
PlanSchemaValidatorTest::aColumnTheTableDoesNotHaveIsRejectedcallsPlanSchemaValidatorTest::testAGeneratedColumnCannotBeLinkedcallsPlanSchemaValidatorTest::testAGeneratedColumnCannotBeWrittenIntoEithercallsPlanSchemaValidatorTest::testATableNamedWithoutAnyRelationIsCheckedToocallsPlanSchemaValidatorTest::testATableTheResolverDoesNotKnowIsRejectedcallsPlanSchemaValidatorTest::testValidateAPlanMatchingTheSchemaPassescalls
Other tests reaching this symbol 5
PostgreSqlEndToEndTestcallsSqliteIntegrationTestcallsPlanGeneratorTestcallsFixtureProviderTestcallsSqlSchemaProviderTestcalls