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 2
Calls 13
- method-call PlanStatements::split() line 35
- new PlanStatements line 35
- new EmptyPlanException line 37
- function-call
preg_matchline 43 - method-call ChoiceSyntax::parse() line 44
- new ChoiceSyntax line 44
- function-call
str_containsline 47 - new UnsupportedManyToManyException line 48
- method-call RelationReader::parseStatement() line 50
- new RelationReader line 50
- new RelationCursor line 50
- function-call
is_stringline 51 - new FixturePlan line 59
Test cases 75§
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 53
PostgreSqlEndToEndTestcallsSqliteIntegrationTestcallsCaseSelectionTestcallsChoiceBindingsTestcallsChoiceValueExceptionTestcallsInverseRelationsTestcallsResolvedRowTestcallsRowChoicesTestcallsConnectedTablesTestcallsOverrideSpecsTestcallsRecursiveRelationExceptionTestcallsRelationCountsTestcallsRelationProjectionTestcallsRelationValueExceptionTestcallsRowBindingsTestcallsRowMaterializerTestcallsGenerationRunTestcallsPlanGeneratorTestcallsPlanSchemaExceptionTestcallsPlanSchemaValidatorTestcallsEndpointValidatorTestcallsConstructorHydrationTestcallsPropertyHydrationTestcallsChoiceCaseTestcallsChoiceDefinitionExceptionTestcallsChoiceLiteralTestcallsChoiceSyntaxTestcallsChoiceValidationTestcallsPlanContentsTestcallsColumnRefTestcallsFixturePlanTestcallsPlanStatementsTestcallsRelationCursorTestcallsRelationReaderTestcallsPlanPrinterTest::readingBackWhatWasPrintedGivesTheSameTextcallsPlanPrinterTest::testAStandaloneTableIsWrittenOutAlongsideTheRelationscallsPlanPrinterTest::testDoesNotGroupRelationsWithDifferentOperatorscallsPlanPrinterTest::testDoesNotGroupRelationsWithDifferentOptionalMarkerscallsPlanPrinterTest::testPrintsARelationWithSpacesAroundTheOperatorcallsPlanPrinterTest::testPrintsOptionalMarkersOnTheSideTheyBelongTocallsPlanPrinterTest::testRegroupsRelationsThatShareALeftEndcallsPlanPrinterTest::testSeveralStandaloneTablesKeepTheOrderTheyWereNamedIncallsPlanStructureExceptionTestcallsPlanSyntaxExceptionTestcallsPlanTablesTestcallsRelationGroupsTestcallsStatementPrinterTestcallsRelationChoiceTestcallsRelationTestcallsPlanValidationTestcallsTableNameTestcallsFixtureProviderTestcallsSqlSchemaProviderTestcalls