classRowMaterializer
final class RowMaterializer
Walks the relations needed to materialize one connected fixture group.
Methods§
public function __construct(
private SchemaResolverInterface $schemas,
private RowGeneration $generator,
private Generator $faker,
)Uses one schema registry, row generator and random source for the walk.
Parameters
$schemas | SchemaResolverInterface | |
$generator | RowGeneration | |
$faker | Generator |
public function materialize(
FixturePlan $plan,
string $table,
array<mixed> $inherited,
int $count,
bool $isList,
?Relation $arrivedBy,
GenerationRun $run,
list<string> $path = [],
): voidParameters
$plan | FixturePlan | |
$table | string | |
$inherited | array<mixed> | Columns already fixed by the relation walked in on |
$count | int | |
$isList | bool | |
$arrivedBy | ?Relation | |
$run | GenerationRun | |
$path | list<string> |
Test cases 2
Called from 3
- method-call SqlFixture\Fixture\Generation\RowMaterializer::materializeParent() packages/sql-fixture/src/Fixture/Generation/RowMaterializer.php:77
- method-call SqlFixture\Fixture\Generation\RowMaterializer::toChildren() packages/sql-fixture/src/Fixture/Generation/RowMaterializer.php:185
- method-call SqlFixture\Fixture\PlanGenerator::generate() packages/sql-fixture/src/Fixture/PlanGenerator.php:55
Calls 8
- function-call
in_arrayline 48 - function-call
countline 48 - function-call
array_keysline 48 - new RecursiveRelationException line 49
- method-call GenerationRun::reached() line 52
- method-call SchemaResolverInterface::resolve() line 54
- method-call GenerationRun::specFor() line 55
- method-call RowMaterializer::materializeRow() line 58
public function materializeParent(
FixturePlan $plan,
string $table,
bool $isList,
Relation $arrivedBy,
GenerationRun $run,
list<string> $path = [],
array<mixed> $inherited = [],
): array<string, mixed>Generate the single row a relation points at.
Parameters
$plan | FixturePlan | |
$table | string | |
$isList | bool | |
$arrivedBy | Relation | |
$run | GenerationRun | |
$path | list<string> | |
$inherited | array<mixed> |
Returns
array<string, mixed>Called from 1
Calls 2
- method-call RowMaterializer::materialize() line 77
- method-call GenerationRun::lastRow() line 79
public function materializeRow(
FixturePlan $plan,
TableSchema $schema,
array<mixed> $inherited,
RowSpec $spec,
int $index,
bool $isList,
?Relation $arrivedBy,
GenerationRun $run,
list<string> $path = [],
): voidParameters
$plan | FixturePlan | |
$schema | TableSchema | |
$inherited | array<mixed> | |
$spec | RowSpec | |
$index | int | |
$isList | bool | |
$arrivedBy | ?Relation | |
$run | GenerationRun | |
$path | list<string> |
Test cases 1
Called from 1
Calls 13
- method-call RowSpec::overridesFor() line 97
- method-call RowChoices::resolve() line 98
- new RowChoices line 98
- method-call RowBindings::merge() line 101
- new RowBindings line 101
- method-call InverseRelations::unique() line 110
- new InverseRelations line 110
- method-call RowMaterializer::toParent() line 115
- method-call GenerationRun::record() line 118
- method-call RowGeneration::generate() line 120
- method-call RelationProjection::referencedColumns() line 121
- new RelationProjection line 121
- method-call RowMaterializer::toChildren() line 129
public function toParent(
FixturePlan $plan,
Relation $relation,
array<mixed> $overrides,
bool $isList,
GenerationRun $run,
list<string> $path = [],
): array<string, mixed>Generate the one row this one references and read the linking columns off it.
Where the caller has already fixed every linking column they have said what the row references, so no parent is invented to contradict them.
Parameters
$plan | FixturePlan | |
$relation | Relation | |
$overrides | array<mixed> | |
$isList | bool | |
$run | GenerationRun | |
$path | list<string> |
Returns
array<string, mixed>Test cases 1
Called from 1
Calls 9
- method-call RelationProjection::isAlreadyLinked() line 152
- new RelationProjection line 152
- method-call Relation::parentIsOptional() line 156
- method-call GenerationRun::wasAskedFor() line 156
- method-call Relation::parent() line 156
- method-call Relation::columnMap() line 161
- function-call
array_key_existsline 162 - method-call RowMaterializer::materializeParent() line 166
- method-call RelationProjection::project() line 168
public function toChildren(
FixturePlan $plan,
Relation $relation,
array<string, mixed> $row,
bool $isList,
GenerationRun $run,
list<string> $path = [],
): voidParameters
$plan | FixturePlan | |
$relation | Relation | |
$row | array<string, mixed> | |
$isList | bool | |
$run | GenerationRun | |
$path | list<string> |
Test cases 1
Called from 1
Calls 8
- method-call Relation::child() line 183
- method-call RowMaterializer::materialize() line 185
- method-call RelationProjection::project() line 188
- new RelationProjection line 188
- method-call RelationCounts::resolveCount() line 189
- new RelationCounts line 189
- method-call GenerationRun::specFor() line 189
- method-call Relation::childIsCollection() line 190
Private surface 3§
Implementation details, listed for orientation only.
private SchemaResolverInterface $schemasprivate RowGeneration $generatorprivate Generator $fakerTest cases 11§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 6
RowMaterializerTest::testMaterializeBoundsAnOptionalSelfRelationAfterAnotherTablecallsRowMaterializerTest::testMaterializeLinksEveryChildToTheGeneratedParentcallsRowMaterializerTest::testMaterializeParentDoesNotWalkBackAlongTheArrivalRelationcallsRowMaterializerTest::testMaterializeRowPreservesExplicitKeyscallsRowMaterializerTest::testToChildrenCopiesTheExistingParentKeycallsRowMaterializerTest::testToParentProjectsGeneratedKeyscalls
Other tests reaching this symbol 5
PostgreSqlEndToEndTestcallsSqliteIntegrationTestcallsPlanGeneratorTestcallsFixtureProviderTestcallsSqlSchemaProviderTestcalls