classRowSpec
final class RowSpec<TValue>
What the caller asked for, for one table.
The second argument of fixture() only overrides what would otherwise be generated, so a table may be described four ways:
3 three rows, every column generated ['status' => 'paid'] every row has that status, count still free [[...], [...]] one entry per row [] no rows at all
An absent table is not described at all, and everything about it, count included, is generated.
Properties§
public ?int $countMethods§
public function __construct(
public ?int $count,
private list<array<TValue>>|null $rows,
private array<TValue> $sharedOverrides,
)Parameters
$count | ?int | |
$rows | list<array<TValue>>|null | Overrides per row, or null when the count is free |
$sharedOverrides | array<TValue> |
public static function unspecified(): selfLeaves both the row count and column values to generation.
Returns
selfTest cases 2
Called from 1
Calls 1
- new
selfline 42
public static function from(string $table, int|array<mixed>|TableOverrides $spec): selfParameters
$table | string | |
$spec | int|array<mixed>|TableOverrides |
Returns
selfThrows
InvalidArgumentException If the shape is not one of the fourTest cases 17
RelationCountsTest::testResolveCountHonorsExplicitRowsAndCardinalitycallsRowMaterializerTest::testMaterializeLinksEveryChildToTheGeneratedParentcallsRowMaterializerTest::testMaterializeParentDoesNotWalkBackAlongTheArrivalRelationcallsRowMaterializerTest::testMaterializeRowPreservesExplicitKeyscallsRowMaterializerTest::testToChildrenCopiesTheExistingParentKeycallsRowMaterializerTest::testToParentProjectsGeneratedKeyscallsGenerationRunTest::testSpecForFallsBackToUnspecifiedcallsGenerationRunTest::testWasAskedForReportsWhatTheCallerMentionedcallsRowSpecTest::testAKeyedArrayOfArraysIsStillOneSetOfValuescallsRowSpecTest::testAListGivesOneEntryPerRowcallsRowSpecTest::testAListOfScalarsIsReadAsColumnValuesNotRowscallsRowSpecTest::testAListOfTableOverridesGivesOneEntryPerRowcallsRowSpecTest::testAnEmptyArrayMeansNoRowscallsRowSpecTest::testFromAnIntegerIsACountWithNothingOverriddencallsRowSpecTest::testOverridesForOneSetOfValuesAppliesToEveryRowcallsRowSpecTest::testTableOverridesApplyToEveryRowcallsRowSpecTest::testZeroIsAValidCountcalls
Called from 1
Calls 7
- function-call
is_intline 51 - new
InvalidArgumentExceptionline 53 - function-call
sprintfline 54 - new
selfline 58 - method-call OverrideRows::asRows() line 65
- new OverrideRows line 65
- function-call
countline 67
public function overridesFor(int $index): array<mixed>Overrides for one row of the given index.
Parameters
$index | int |
Returns
array<mixed>Private surface 2§
Implementation details, listed for orientation only.
private list<array<TValue>>|null $rowsprivate array<TValue> $sharedOverridesTest cases 26§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 10
RowSpecTest::testAKeyedArrayOfArraysIsStillOneSetOfValuescallsRowSpecTest::testAListGivesOneEntryPerRowcallsRowSpecTest::testAListOfScalarsIsReadAsColumnValuesNotRowscallsRowSpecTest::testAListOfTableOverridesGivesOneEntryPerRowcallsRowSpecTest::testAnEmptyArrayMeansNoRowscallsRowSpecTest::testFromAnIntegerIsACountWithNothingOverriddencallsRowSpecTest::testOverridesForOneSetOfValuesAppliesToEveryRowcallsRowSpecTest::testTableOverridesApplyToEveryRowcallsRowSpecTest::testUnspecifiedAnUnspecifiedTableLeavesTheCountFreecallsRowSpecTest::testZeroIsAValidCountcalls
Other tests reaching this symbol 16
PostgreSqlEndToEndTestcallsSqliteIntegrationTestcallsOverrideSpecsTestcallsRelationCountsTest::testResolveCountHonorsExplicitRowsAndCardinalitycallsRowMaterializerTest::testMaterializeLinksEveryChildToTheGeneratedParentcallsRowMaterializerTest::testMaterializeParentDoesNotWalkBackAlongTheArrivalRelationcallsRowMaterializerTest::testMaterializeRowPreservesExplicitKeyscallsRowMaterializerTest::testToChildrenCopiesTheExistingParentKeycallsRowMaterializerTest::testToParentProjectsGeneratedKeyscallsGenerationRunTest::testSpecForFallsBackToUnspecifiedcallsGenerationRunTest::testWasAskedForReportsWhatTheCallerMentionedcallsPlanGeneratorTestcallsFixtureProviderTestcallsConstructorHydrationTestcallsPropertyHydrationTestcallsSqlSchemaProviderTestcalls
Relations§
Static calls 2
Method calls 1
Type declarations 3
- type SqlFixture\Fixture\Generation\RelationCounts packages/sql-fixture/src/Fixture/Generation/RelationCounts.php:30
- type SqlFixture\Fixture\Generation\RowMaterializer packages/sql-fixture/src/Fixture/Generation/RowMaterializer.php:78
- type SqlFixture\Fixture\GenerationRun packages/sql-fixture/src/Fixture/GenerationRun.php:78