classPlanParser
final class PlanParser
Reads the relation syntax of DBML into a plan.
order.id < order_detail.order_id order_detail.order_id > order.id order.id - order_shipping.order_id order.(shop_id, no) < order_detail.(shop_id, order_no) order.id < [order_detail.order_id, shipment.order_id] order_detail.order_id >? order.id
Relations are separated by a comma or a newline. A plan naming a single table and no relation is just that table name, so every table name is already a valid plan.
Methods§
public function parse(string $plan): FixturePlanParameters
$plan | string |
Returns
Throws
Test cases 30
PlanParserTest::identifiersMayBeQuotedcallsPlanParserTest::testAGroupedTargetExpandsToOneRelationPerEndpointcallsPlanParserTest::testAGroupFollowedByAnotherRelationStillSplitsCorrectlycallsPlanParserTest::testAMarkerAfterTheOperatorMarksTheRightSideOptionalcallsPlanParserTest::testAMarkerBeforeTheOperatorMarksTheLeftSideOptionalcallsPlanParserTest::testAnEmptyStatementBetweenTwoRelationsIsIgnoredcallsPlanParserTest::testAStrayClosingBracketDoesNotStopLaterRelationsSplittingcallsPlanParserTest::testAStrayOpeningBracketDoesNotSwallowLaterRelationscallsPlanParserTest::testATableNameFollowedByRelationsKeepsThemAllcallsPlanParserTest::testCommasInsideBracketsDoNotSeparateRelationscallsPlanParserTest::testCommasSeparateRelationscallsPlanParserTest::testNewlinesSeparateRelationscallsPlanParserTest::testParseABareTableNameIsAPlanWithNoRelationscallsPlanParserTest::testReadsACompositeEndpointcallsPlanParserTest::testReadsAManyToOneRelationcallsPlanParserTest::testReadsAOneToManyRelationcallsPlanParserTest::testReadsAOneToOneRelationcallsPlanParserTest::testSemicolonsSeparateRelationscallsPlanParserTest::testSurroundingWhitespaceIsIgnoredcallsPlanParserTest::testTablesAreListedInFirstMentionedOrderWithoutRepeatscallsPlanParserTest::testWhitespaceBetweenAnEndpointAndTheOperatorIsSkippedcallsPlanParserTest::testWhitespaceInsideAGroupIsSkippedcallsPlanPrinterTest::readingBackWhatWasPrintedGivesTheSameTextcallsPlanPrinterTest::testAStandaloneTableIsWrittenOutAlongsideTheRelationscallsPlanPrinterTest::testDoesNotGroupRelationsWithDifferentOperatorscallsPlanPrinterTest::testDoesNotGroupRelationsWithDifferentOptionalMarkerscallsPlanPrinterTest::testPrintsARelationWithSpacesAroundTheOperatorcallsPlanPrinterTest::testPrintsOptionalMarkersOnTheSideTheyBelongTocallsPlanPrinterTest::testRegroupsRelationsThatShareALeftEndcallsPlanPrinterTest::testSeveralStandaloneTablesKeepTheOrderTheyWereNamedIncalls
Called from 1
Calls 10
- function-call
str_containsline 35 - new UnsupportedManyToManyException line 36
- method-call PlanStatements::split() line 39
- new PlanStatements line 39
- new EmptyPlanException line 41
- method-call RelationReader::parseStatement() line 47
- new RelationReader line 47
- new RelationCursor line 47
- function-call
is_stringline 48 - new FixturePlan line 56
Test cases 59§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 22
PlanParserTest::identifiersMayBeQuotedcallsPlanParserTest::testAGroupedTargetExpandsToOneRelationPerEndpointcallsPlanParserTest::testAGroupFollowedByAnotherRelationStillSplitsCorrectlycallsPlanParserTest::testAMarkerAfterTheOperatorMarksTheRightSideOptionalcallsPlanParserTest::testAMarkerBeforeTheOperatorMarksTheLeftSideOptionalcallsPlanParserTest::testAnEmptyStatementBetweenTwoRelationsIsIgnoredcallsPlanParserTest::testAStrayClosingBracketDoesNotStopLaterRelationsSplittingcallsPlanParserTest::testAStrayOpeningBracketDoesNotSwallowLaterRelationscallsPlanParserTest::testATableNameFollowedByRelationsKeepsThemAllcallsPlanParserTest::testCommasInsideBracketsDoNotSeparateRelationscallsPlanParserTest::testCommasSeparateRelationscallsPlanParserTest::testNewlinesSeparateRelationscallsPlanParserTest::testParseABareTableNameIsAPlanWithNoRelationscallsPlanParserTest::testReadsACompositeEndpointcallsPlanParserTest::testReadsAManyToOneRelationcallsPlanParserTest::testReadsAOneToManyRelationcallsPlanParserTest::testReadsAOneToOneRelationcallsPlanParserTest::testSemicolonsSeparateRelationscallsPlanParserTest::testSurroundingWhitespaceIsIgnoredcallsPlanParserTest::testTablesAreListedInFirstMentionedOrderWithoutRepeatscallsPlanParserTest::testWhitespaceBetweenAnEndpointAndTheOperatorIsSkippedcallsPlanParserTest::testWhitespaceInsideAGroupIsSkippedcalls
Other tests reaching this symbol 37
PostgreSqlEndToEndTestcallsSqliteIntegrationTestcallsConnectedTablesTestcallsOverrideSpecsTestcallsRelationCountsTestcallsRelationProjectionTestcallsRowMaterializerTestcallsGenerationRunTestcallsPlanGeneratorTestcallsPlanSchemaExceptionTestcallsPlanSchemaValidatorTestcallsEndpointValidatorTestcallsFixtureProviderTestcallsConstructorHydrationTestcallsPropertyHydrationTestcallsColumnRefTestcallsFixturePlanTestcallsPlanStatementsTestcallsRelationCursorTestcallsRelationReaderTestcallsPlanPrinterTest::readingBackWhatWasPrintedGivesTheSameTextcallsPlanPrinterTest::testAStandaloneTableIsWrittenOutAlongsideTheRelationscallsPlanPrinterTest::testDoesNotGroupRelationsWithDifferentOperatorscallsPlanPrinterTest::testDoesNotGroupRelationsWithDifferentOptionalMarkerscallsPlanPrinterTest::testPrintsARelationWithSpacesAroundTheOperatorcallsPlanPrinterTest::testPrintsOptionalMarkersOnTheSideTheyBelongTocallsPlanPrinterTest::testRegroupsRelationsThatShareALeftEndcallsPlanPrinterTest::testSeveralStandaloneTablesKeepTheOrderTheyWereNamedIncallsPlanStructureExceptionTestcallsPlanSyntaxExceptionTestcallsPlanTablesTestcallsRelationGroupsTestcallsStatementPrinterTestcallsRelationTestcallsPlanValidationTestcallsTableNameTestcallsSqlSchemaProviderTestcalls