classTableSchema
final class TableSchema
Holds the named columns and ordered primary key of one table.
Properties§
public string $tableNamepublic array<string, ColumnDefinition> $columnspublic list<string> $primaryKeys = []Methods§
public function __construct(
public string $tableName,
public array<string, ColumnDefinition> $columns,
public list<string> $primaryKeys = [],
)Parameters
$tableName | string | |
$columns | array<string, ColumnDefinition> | |
$primaryKeys | list<string> |
public function getColumn(string $name): ?ColumnDefinitionReturns column.
Parameters
$name | string |
Returns
Test cases 2
public function hasColumn(string $name): boolReturns has column.
Parameters
$name | string |
Returns
boolTest cases 1
public function getColumnNames(): list<string>Returns
list<string>Test cases 1
Called from 2
- method-call SqlFixture\Fixture\Exception\UnknownOverrideColumnException::__construct() packages/sql-fixture/src/Fixture/Exception/UnknownOverrideColumnException.php:25
- method-call SqlFixture\Fixture\Exception\UnknownPlanColumnException::__construct() packages/sql-fixture/src/Fixture/Exception/UnknownPlanColumnException.php:29
Calls 1
- function-call
array_keysline 44
Test cases 129§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 5
Other tests reaching this symbol 124
PostgreSqlEndToEndTestcallsSqliteIntegrationTestcallsGeneratedColumnOverrideExceptionTest::testDescribesGeneratedColumnOverridecallsGeneratedColumnReferenceExceptionTest::testDescribesGeneratedColumnReferencecallsInvalidOverrideExceptionTest::testGeneratedColumnSaysTheDatabaseComputesItcallsInvalidOverrideExceptionTest::testNotNullableSaysWhyNullIsRefusedcallsInvalidOverrideExceptionTest::testUnknownColumnListsWhatTheTableHascallsNullOverrideExceptionTest::testDescribesNullOverridecallsUnknownOverrideColumnExceptionTest::testDescribesUnknownOverrideColumncallsUnknownPlanColumnExceptionTest::testDescribesUnknownPlanColumncallsRelationProjectionTestcallsRowMaterializerTest::testMaterializeBoundsAnOptionalSelfRelationAfterAnotherTablecallsRowMaterializerTest::testMaterializeLinksEveryChildToTheGeneratedParentcallsRowMaterializerTest::testMaterializeParentDoesNotWalkBackAlongTheArrivalRelationcallsRowMaterializerTest::testMaterializeRowPreservesExplicitKeyscallsRowMaterializerTest::testToChildrenCopiesTheExistingParentKeycallsRowMaterializerTest::testToParentProjectsGeneratedKeyscallsGenerationRunTest::testAKeyARelationReadsIsStoodInForcallsGenerationRunTest::testAKeyNothingReadsIsLeftToTheDatabasecallsGenerationRunTest::testClaimingDoesNotUndoWhatTheWalkAlreadyLearntcallsGenerationRunTest::testEveryReferencedColumnIsConsideredNotJustTheFirstcallsGenerationRunTest::testLastRowReturnsTheMostRecentRecordedValuescallsGenerationRunTest::testOnlyAutoIncrementColumnsAreStoodInForcallsGenerationRunTest::testRecordKeepsAKeyTheCallerSuppliedcallsGenerationRunTest::testRecordReturnsTheWholeRowcallsGenerationRunTest::testToSetATableReachedOnlyAsASingleRowReadsBackAsOnecallsPlanGeneratorTest::testACompositeRelationCarriesEveryColumncallsPlanGeneratorTest::testACountOfZeroGeneratesNoRowscallsPlanGeneratorTest::testAListGivesOneRowPerEntrycallsPlanGeneratorTest::testAnOptionalChildMayGenerateNoneAtAllcallsPlanGeneratorTest::testAnOptionalOneToOneAskedForNoneIsNullcallsPlanGeneratorTest::testAnOptionalParentIsGeneratedWhenTheCallerAsksForItcallsPlanGeneratorTest::testAnOptionalParentNobodyAskedForIsLeftOutcallsPlanGeneratorTest::testAnUnboundedChildCountCanExceedItsMinimumcallsPlanGeneratorTest::testAnUnmentionedChildIsStillGeneratedcallsPlanGeneratorTest::testAOneToOneChildIsASingleRowcallsPlanGeneratorTest::testAOneToOneChildIsGeneratedExactlyOncecallsPlanGeneratorTest::testAOneToOneChildIsNeverGeneratedMoreThanOncecallsPlanGeneratorTest::testAParentIsGeneratedAndLinkedTocallsPlanGeneratorTest::testAPlanNamingAColumnTheTableLacksIsRejectedBeforeGeneratingcallsPlanGeneratorTest::testARequiredChildNeverGeneratesNonecallsPlanGeneratorTest::testARequiredParentIsGeneratedWhetherOrNotItWasAskedForcallsPlanGeneratorTest::testARowCarriesBothItsInheritedKeyAndItsOwnParentKeycallsPlanGeneratorTest::testATableReachableOnlyBackwardsAlongARelationIsStillPartOfTheWalkcallsPlanGeneratorTest::testChildRowsCarryTheParentKeycallsPlanGeneratorTest::testEntriesComeBackInTheOrderThePlanNamesThemcallsPlanGeneratorTest::testEveryChildOfAListGetsItsOwnParentcallsPlanGeneratorTest::testEveryOtherRelationOfAParentIsStillFollowedcallsPlanGeneratorTest::testFixingTheLinkingColumnLeavesTheParentAlonecallsPlanGeneratorTest::testGenerateAllRelationsInTheSelectedBranchcallsPlanGeneratorTest::testGenerateChildTablesSelectedPerPaymentcallsPlanGeneratorTest::testGenerateCompositeChoiceKeyscallsPlanGeneratorTest::testGenerateConflictingChildKeysAreRejectedcallsPlanGeneratorTest::testGenerateConflictingInverseDiscriminatorIsRejectedcallsPlanGeneratorTest::testGenerateConflictingParentKeysAreRejectedcallsPlanGeneratorTest::testGenerateExplicitReferencesWithoutInventingParentscallsPlanGeneratorTest::testGenerateFallbackAndNullBranchescallsPlanGeneratorTest::testGenerateInverseEquivalentCasesOncePerChildcallsPlanGeneratorTest::testGenerateInversePolymorphicChildrencallsPlanGeneratorTest::testGenerateInverseSubtypeParentcallsPlanGeneratorTest::testGenerateMixedChoiceRowscallsPlanGeneratorTest::testGenerateOptionalParentsWithNullReferencescallsPlanGeneratorTest::testGeneratePartialCompositeOverridesAreCarriedToTheParentcallsPlanGeneratorTest::testGeneratePolymorphicJunctionRowscallsPlanGeneratorTest::testGenerateRepeatedRolesFailWithoutUnboundedRecursioncallsPlanGeneratorTest::testGenerateSeededCaseSelectionIsReproduciblecallsPlanGeneratorTest::testGenerateTheTableThePlanIsAboutGetsOneRowcallsPlanGeneratorTest::testGenerateUnknownDiscriminatorColumnsAreRejectedcallsPlanGeneratorTest::testGenerateUnknownDiscriminatorReportsItsColumncallsPlanGeneratorTest::testKeysAreStoodInForEveryColumnARelationReadscallsPlanGeneratorTest::testOneSetOfValuesAppliesToEveryGeneratedRowcallsPlanGeneratorTest::testOverridesMayBeGivenAsTableOverridescallsPlanGeneratorTest::testTablesThatStandAloneAreGeneratedToocallsPlanGeneratorTest::testTheSubjectHonoursACountItWasGivencallsPlanGeneratorTest::testTheSubjectIsOneRowEvenWhenSomethingReferencesItcallsPlanSchemaExceptionTest::testGeneratedColumnExplainsWhyItCannotCarryAValuecallsPlanSchemaExceptionTest::testUnknownColumnNamesTheLinkTheTableAndWhatItDoesHavecallsPlanSchemaValidatorTest::aColumnTheTableDoesNotHaveIsRejectedcallsPlanSchemaValidatorTest::testAGeneratedColumnCannotBeLinkedcallsPlanSchemaValidatorTest::testAGeneratedColumnCannotBeWrittenIntoEithercallsPlanSchemaValidatorTest::testATableNamedWithoutAnyRelationIsCheckedToocallsPlanSchemaValidatorTest::testATableTheResolverDoesNotKnowIsRejectedcallsPlanSchemaValidatorTest::testValidateAPlanMatchingTheSchemaPassescallsRowGenerationTest::testGenerateAppliesExplicitValuesAndOmitsGeneratedColumnscallsRowGeneratorTest::testGenerateDelegatesObjectHydrationcallsRowGeneratorTest::testGenerateUsesInjectedMappingAndPreservesOverridescallsEndpointValidatorTest::testCheckEndpointAcceptsDeclaredLinkColumnscallsOverrideValidatorTest::testAssertOverridesFitSchemaAcceptsNullableAndExplicitKeyscallsConstructorHydrationTestcallsPropertyHydrationTestcallsMySqlSchemaFetcherTestcallsMySqlSchemaParserTestcallsPostgreSqlSchemaFetcherTestcallsPostgreSqlSchemaParserTestcallsCatalogSchemaTestcallsPragmaColumnTestcallsPragmaSchemaTestcallsSqliteSchemaFetcherTestcallsSqliteSchemaParserTestcallsDatabaseFixtureProviderTest::testGetFixtureGeneratorReturnsInstancecallsDatabaseSchemaCacheTestcallsDdlDirectoryTestcallsDdlFileTestcallsFileFixtureProviderTest::testGetFixtureGeneratorcallsFixtureGeneratorTest::testAnOverrideForAnAutoIncrementColumnIsStillAllowedcallsFixtureGeneratorTest::testGenerateSkipsAutoIncrementcallsFixtureGeneratorTest::testGenerateSkipsGeneratedColumnscallsFixtureGeneratorTest::testGenerateWithHydrationcallsFixtureGeneratorTest::testGenerateWithOverridescallsFixtureGeneratorTest::testGenerateWithSchemacallsFixtureGeneratorTest::testNullIsAcceptedForANullableColumncallsFixtureProviderTest::testGetFixtureGeneratorcallsPlatformFactoryTestcallsSqlSchemaProviderTestcallsSchemaFetcherInterfaceTestcallsSchemaParserInterfaceTestcallsSchemaResolverInterfaceTest::testHasReportsAvailabilityBeforeResolutioncallsSchemaResolverInterfaceTest::testResolveReturnsTheRegisteredSchemacallsStaticSchemaResolverTest::testRegisterAddsAfterConstructioncallsStaticSchemaResolverTest::testRegisterReplacesASchemaOfTheSameNamecallsStaticSchemaResolverTest::testResolvesARegisteredSchemacallsStaticSchemaResolverTest::testResolvesIgnoringCaseQuotingAndSchemaQualifiercallsStaticSchemaResolverTest::testResolveThrowsListingWhatIsKnowncallsStaticSchemaResolverTest::testTableNamesAreLowerCasedcalls
Relations§
Instantiated in 5
- new SqlFixture\Platform\MySql\MySqlSchemaParser::parse() packages/sql-fixture/src/Platform/MySql/MySqlSchemaParser.php:42
- new SqlFixture\Platform\PostgreSql\PostgreSqlSchemaParser::parse() packages/sql-fixture/src/Platform/PostgreSql/PostgreSqlSchemaParser.php:48
- new SqlFixture\Platform\PostgreSql\Schema\CatalogSchema::fetchSchemaFromInformationSchema() packages/sql-fixture/src/Platform/PostgreSql/Schema/CatalogSchema.php:65
- new SqlFixture\Platform\Sqlite\Schema\PragmaSchema::fetchSchemaViaPragma() packages/sql-fixture/src/Platform/Sqlite/Schema/PragmaSchema.php:51
- new SqlFixture\Platform\Sqlite\SqliteSchemaParser::parse() packages/sql-fixture/src/Platform/Sqlite/SqliteSchemaParser.php:51
Method calls 4
- method-call SqlFixture\Fixture\Exception\UnknownOverrideColumnException::__construct() packages/sql-fixture/src/Fixture/Exception/UnknownOverrideColumnException.php:25
- method-call SqlFixture\Fixture\Exception\UnknownPlanColumnException::__construct() packages/sql-fixture/src/Fixture/Exception/UnknownPlanColumnException.php:29
- method-call SqlFixture\Fixture\GenerationRun::record() packages/sql-fixture/src/Fixture/GenerationRun.php:98
- method-call SqlFixture\Fixture\Validation\OverrideValidator::assertOverridesFitSchema() packages/sql-fixture/src/Fixture/Validation/OverrideValidator.php:33
Type declarations 28
- type SqlFixture\Fixture\Exception\GeneratedColumnOverrideException packages/sql-fixture/src/Fixture/Exception/GeneratedColumnOverrideException.php:19
- type SqlFixture\Fixture\Exception\GeneratedColumnReferenceException packages/sql-fixture/src/Fixture/Exception/GeneratedColumnReferenceException.php:22
- type SqlFixture\Fixture\Exception\NullOverrideException packages/sql-fixture/src/Fixture/Exception/NullOverrideException.php:19
- type SqlFixture\Fixture\Exception\UnknownOverrideColumnException packages/sql-fixture/src/Fixture/Exception/UnknownOverrideColumnException.php:19
- type SqlFixture\Fixture\Exception\UnknownPlanColumnException packages/sql-fixture/src/Fixture/Exception/UnknownPlanColumnException.php:22
- type SqlFixture\Fixture\Generation\RowMaterializer packages/sql-fixture/src/Fixture/Generation/RowMaterializer.php:88
- type SqlFixture\Fixture\GenerationRun packages/sql-fixture/src/Fixture/GenerationRun.php:95
- type SqlFixture\Fixture\RowGeneration packages/sql-fixture/src/Fixture/RowGeneration.php:24
- type SqlFixture\Fixture\RowGenerator packages/sql-fixture/src/Fixture/RowGenerator.php:34
- type SqlFixture\Fixture\Validation\OverrideValidator packages/sql-fixture/src/Fixture/Validation/OverrideValidator.php:27
- type SqlFixture\Platform\MySql\MySqlSchemaFetcher packages/sql-fixture/src/Platform/MySql/MySqlSchemaFetcher.php:29
- type SqlFixture\Platform\MySql\MySqlSchemaParser packages/sql-fixture/src/Platform/MySql/MySqlSchemaParser.php:23
- type SqlFixture\Platform\PostgreSql\PostgreSqlSchemaFetcher packages/sql-fixture/src/Platform/PostgreSql/PostgreSqlSchemaFetcher.php:32
- type SqlFixture\Platform\PostgreSql\PostgreSqlSchemaParser packages/sql-fixture/src/Platform/PostgreSql/PostgreSqlSchemaParser.php:27
- type SqlFixture\Platform\PostgreSql\Schema\CatalogSchema packages/sql-fixture/src/Platform/PostgreSql/Schema/CatalogSchema.php:23
- type SqlFixture\Platform\Sqlite\Schema\PragmaSchema packages/sql-fixture/src/Platform/Sqlite/Schema/PragmaSchema.php:22
- type SqlFixture\Platform\Sqlite\SqliteSchemaFetcher packages/sql-fixture/src/Platform/Sqlite/SqliteSchemaFetcher.php:33
- type SqlFixture\Platform\Sqlite\SqliteSchemaParser packages/sql-fixture/src/Platform/Sqlite/SqliteSchemaParser.php:30
- type SqlFixture\Provider\DatabaseSchemaCache packages/sql-fixture/src/Provider/DatabaseSchemaCache.php:33
- type SqlFixture\Provider\DdlFile packages/sql-fixture/src/Provider/DdlFile.php:23
- type SqlFixture\Provider\FixtureGenerator packages/sql-fixture/src/Provider/FixtureGenerator.php:50
- type SqlFixture\Provider\FixtureProvider packages/sql-fixture/src/Provider/FixtureProvider.php:119
- type SqlFixture\Provider\SqlSchemaProvider packages/sql-fixture/src/Provider/SqlSchemaProvider.php:29
- type SqlFixture\Schema\SchemaFetcherInterface packages/sql-fixture/src/Schema/SchemaFetcherInterface.php:22
- type SqlFixture\Schema\SchemaParserInterface packages/sql-fixture/src/Schema/SchemaParserInterface.php:17
- type SqlFixture\Schema\SchemaResolverInterface packages/sql-fixture/src/Schema/SchemaResolverInterface.php:18
- type SqlFixture\Schema\StaticSchemaResolver packages/sql-fixture/src/Schema/StaticSchemaResolver.php:30
- type SqlFixture\Schema\StaticSchemaResolver packages/sql-fixture/src/Schema/StaticSchemaResolver.php:39