classLoader
final class Loader
Loads a project from its requirements.yaml and the definition files it names.
Every document is validated against its schema, every item against the definition rules, links between items and to runners are resolved, and each source format and runner extension must be registered.
Methods§
public function load(string $file): ProjectLoads and validates a project.
Parameters
$file | string | The configuration file |
Returns
Project The projectThrows
InvalidInputException When the configuration, a definition or a link is invalidJsonException When a document cannot be convertedParseException When a YAML document is malformedTest cases 70
LoaderTest::testLoadDefaultsCoverageToZerocallsLoaderTest::testLoadIncludesBootstrapcallsLoaderTest::testLoadPassesMarkdownOptionscallsLoaderTest::testLoadReadsCoveragecallsLoaderTest::testLoadReadsRunnerscallsLoaderTest::testLoadRegistersExtensionscallsLoaderTest::testLoadRejectsCoverageOutOfRangecallsLoaderTest::testLoadRejectsDefinitionPatternWithoutMatchescallsLoaderTest::testLoadRejectsDefinitionWithoutSourcecallsLoaderTest::testLoadRejectsDuplicateItemIdcallsLoaderTest::testLoadRejectsDuplicateSourceIdcallsLoaderTest::testLoadRejectsInvalidDefinitionscallsLoaderTest::testLoadRejectsMalformedConfigurationcallsLoaderTest::testLoadRejectsMarkdownWithoutOptionscallsLoaderTest::testLoadRejectsMissingBootstrapcallsLoaderTest::testLoadRejectsMissingConfigurationcallsLoaderTest::testLoadRejectsRunnerExtensionOfWrongTypecallsLoaderTest::testLoadRejectsSourceExtensionOfWrongTypecallsLoaderTest::testLoadRejectsTestLinkedToUnknownRunnercallsLoaderTest::testLoadRejectsUnknownExtensionKindcallsLoaderTest::testLoadRejectsUnknownRunnerExtensioncallsLoaderTest::testLoadRejectsUnknownSourceFormatcallsLoaderTest::testLoadRejectsUnknownSourceThresholdcallsLoaderTest::testLoadResolvesConfigurationPathcallsLoaderTest::testLoadReturnsProjectcallsLoaderTest::testLoadValidatesConfigurationSchemacallsReferenceTest::testValidateRejectsALinkToAnotherLoadedDefinitionFilecallsMarkdownDocumentTest::testReadAcceptsTheProposedSelectorCommentAndReasonSpellingcallsMarkdownDocumentTest::testReadMatchesTheYamlModelAndRenderShowsOnlyReaderFacingInformationcallsMarkdownDocumentTest::testReadResolvesCitationsFromTheMarkdownFileAndKeepsQuotationsSeparatecallsMarkdownDocumentTest::testReadSharesTheYamlModelAndRenderPreservesLinksAndBadgescallsMarkdownDocumentTest::testRenderAddsTextFragmentNavigationForAComplexCssSelectorcallsSchemaValidatorTest::testRejectsInvalidTestRunPoliciescallsSchemaValidatorTest::testValidateAddsLocalSchemaConstraintsToBundledSchemacallsSchemaValidatorTest::testValidateRejectsWrongTypesUnknownPropertiesAndDeclarationscallsExecutorTest::testExecuteCheckFailsOnInvalidEvidencecallsExecutorTest::testExecuteCheckReadsLiveSourcescallsExecutorTest::testExecuteCheckReportsValidEvidencecallsExecutorTest::testExecuteCoverageAppliesTheThresholdOptionscallsExecutorTest::testExecuteCoverageRefusesASnapshotOfInvalidEvidencecallsExecutorTest::testExecuteCoverageReportsTheConfiguredModecallsExecutorTest::testExecuteCoverageReportsTheLiveModecallsExecutorTest::testExecuteCoverageWritesAndComparesASnapshotcallsExecutorTest::testExecuteFormatFailsTheCheckWhenADocumentNeedsFormattingcallsExecutorTest::testExecuteFormatReportsNoChangesForCanonicalDocumentscallsExecutorTest::testExecuteFormatRewritesDocumentsAndPassescallsExecutorTest::testExecuteLintCountsTheValidatedItemscallsExecutorTest::testExecuteRejectsAnUnknownCommandcallsExecutorTest::testExecuteSpecAcceptsEmptySelectionByDefaultcallsExecutorTest::testExecuteSpecListsRecordsWithoutRunningTestscallsExecutorTest::testExecuteSpecPassesOnlyWhenEveryItemPassescallsExecutorTest::testStrictSpecRequiresLinksEvenWithoutTestExecutioncallsFormatterTest::testFormatKeepsBundledSchemaDeclarationsAndEmptyMapscallsAnalyzerTest::testAnalyzeContinuesAfterAFailingScopecallsAnalyzerTest::testAnalyzeCountsUnitsSharedByScopesOncecallsAnalyzerTest::testAnalyzeFailsClosedOnInvalidEvidencecallsAnalyzerTest::testAnalyzeKeepsTheValidEvidenceOfAnItemThatClaimsNothingcallsAnalyzerTest::testAnalyzeNeedsASpecificationToClaimARequirementSharedAcrossDefinitionscallsAnalyzerTest::testAnalyzeRecordsScopesEvidenceAndClaimscallsAnalyzerTest::testAnalyzeRejectsEvidenceQuotingRepeatedUnitsAndCountsThemUncoveredcallsAnalyzerTest::testAnalyzeReportsAFailingSourceExtensionForTheScopeAndEveryEvidenceEntrycallsAnalyzerTest::testAnalyzeReportsAnEmptyScopeAsAnErrorAndNotAsFullCoveragecallsAnalyzerTest::testAnalyzeResolvesTheEvidenceOfItemsAfterAnItemWithoutSourcecallsAnalyzerTest::testAnalyzeUsesIndependentScopeAndReasonedDispositioncallsCoverageTest::testReportFailsTheDifferentialGateForANewUncoveredUnitcallsSnapshotTest::testCompareDetectsChangedClaimsNewUnitsAndRemovedScopecallsSnapshotTest::testCreateListsOnlyFingerprintsAndCompareDetectsDriftcallsSnapshotTest::testReadRejectsACoverageReportcallsVerifierTest::testVerifyDoesNotCountAZeroCaseSuccessAsAPassingTargetcallsVerifierTest::testVerifyRunsCustomSourcesAndRunnersThroughTheSamePipelineAndDeduplicatesTestscalls
Called from 1
Calls 24
- function-call
realpathline 38 - new InvalidInputException line 40
- function-call
dirnameline 42 - method-call Loader::document() line 43
- static-call Fields::keys() line 44
- method-call Bootstrap::load() line 46
- new Bootstrap line 46
- static-call Fields::text() line 46
- static-call Fields::mapping() line 48
- method-call DefinitionReader::read() line 49
- new DefinitionReader line 49
- static-call Fields::strings() line 49
- static-call RunnerConfig::from() line 52
- method-call LinkValidator::validate() line 54
- new LinkValidator line 54
- method-call CoverageThresholds::read() line 59
- new CoverageThresholds line 59
- static-call ExtensionClasses::read() line 60
- new Registry line 62
- new Registry line 63
- method-call Registry::get() line 65
- method-call Registry::get() line 68
- new Project line 70
- static-call Fields::percentage() line 70
public function document(
string $path,
string $kind = 'definition',
array<string, mixed> $markdown = [],
): array<string, mixed>Reads and validates one document as a mapping.
Parameters
$path | string | The document file |
$kind | string | "config" or "definition", naming the schema |
$markdown | array<string, mixed> | The markdown options |
Returns
array<string, mixed> The documentThrows
InvalidInputException When the document breaks its schema or is not a mappingJsonException When the document cannot be convertedParseException When a YAML document is malformedTest cases 15
LoaderTest::testDocumentReadsConfigurationcallsLoaderTest::testDocumentReadsDefinitionByDefaultcallsLoaderTest::testDocumentReadsMarkdownWithOptionscallsLoaderTest::testDocumentRejectsMarkdownWithoutOptionscallsLoaderTest::testDocumentValidatesDefaultKindAsDefinitioncallsLoaderTest::testLoadRejectsInvalidDefinitionscallsSchemaValidatorTest::testRejectsInvalidTestRunPoliciescallsSchemaValidatorTest::testValidateAddsLocalSchemaConstraintsToBundledSchemacallsFormatterTest::testFormatKeepsBundledSchemaDeclarationsAndEmptyMapscallsAnalyzerTest::testAnalyzeCountsUnitsSharedByScopesOncecallsAnalyzerTest::testAnalyzeFailsClosedOnInvalidEvidencecallsAnalyzerTest::testAnalyzeNeedsASpecificationToClaimARequirementSharedAcrossDefinitionscallsAnalyzerTest::testAnalyzeReportsAnEmptyScopeAsAnErrorAndNotAsFullCoveragecallsAnalyzerTest::testAnalyzeUsesIndependentScopeAndReasonedDispositioncallsSnapshotTest::testCompareDetectsChangedClaimsNewUnitsAndRemovedScopecalls
Called from 1
Calls 3
- static-call DocumentReader::mapping() line 88
- method-call DocumentReader::read() line 88
- new DocumentReader line 88
Test cases 78§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 31
LoaderTest::testDocumentReadsConfigurationcallsLoaderTest::testDocumentReadsDefinitionByDefaultcallsLoaderTest::testDocumentReadsMarkdownWithOptionscallsLoaderTest::testDocumentRejectsMarkdownWithoutOptionscallsLoaderTest::testDocumentValidatesDefaultKindAsDefinitioncallsLoaderTest::testLoadDefaultsCoverageToZerocallsLoaderTest::testLoadIncludesBootstrapcallsLoaderTest::testLoadPassesMarkdownOptionscallsLoaderTest::testLoadReadsCoveragecallsLoaderTest::testLoadReadsRunnerscallsLoaderTest::testLoadRegistersExtensionscallsLoaderTest::testLoadRejectsCoverageOutOfRangecallsLoaderTest::testLoadRejectsDefinitionPatternWithoutMatchescallsLoaderTest::testLoadRejectsDefinitionWithoutSourcecallsLoaderTest::testLoadRejectsDuplicateItemIdcallsLoaderTest::testLoadRejectsDuplicateSourceIdcallsLoaderTest::testLoadRejectsInvalidDefinitionscallsLoaderTest::testLoadRejectsMalformedConfigurationcallsLoaderTest::testLoadRejectsMarkdownWithoutOptionscallsLoaderTest::testLoadRejectsMissingBootstrapcallsLoaderTest::testLoadRejectsMissingConfigurationcallsLoaderTest::testLoadRejectsRunnerExtensionOfWrongTypecallsLoaderTest::testLoadRejectsSourceExtensionOfWrongTypecallsLoaderTest::testLoadRejectsTestLinkedToUnknownRunnercallsLoaderTest::testLoadRejectsUnknownExtensionKindcallsLoaderTest::testLoadRejectsUnknownRunnerExtensioncallsLoaderTest::testLoadRejectsUnknownSourceFormatcallsLoaderTest::testLoadRejectsUnknownSourceThresholdcallsLoaderTest::testLoadResolvesConfigurationPathcallsLoaderTest::testLoadReturnsProjectcallsLoaderTest::testLoadValidatesConfigurationSchemacalls
Other tests reaching this symbol 47
ReferenceTest::testValidateRejectsALinkToAnotherLoadedDefinitionFilecallsMarkdownDocumentTest::testReadAcceptsTheProposedSelectorCommentAndReasonSpellingcallsMarkdownDocumentTest::testReadMatchesTheYamlModelAndRenderShowsOnlyReaderFacingInformationcallsMarkdownDocumentTest::testReadResolvesCitationsFromTheMarkdownFileAndKeepsQuotationsSeparatecallsMarkdownDocumentTest::testReadSharesTheYamlModelAndRenderPreservesLinksAndBadgescallsMarkdownDocumentTest::testRenderAddsTextFragmentNavigationForAComplexCssSelectorcallsSchemaValidatorTest::testRejectsInvalidTestRunPoliciescallsSchemaValidatorTest::testValidateAddsLocalSchemaConstraintsToBundledSchemacallsSchemaValidatorTest::testValidateRejectsWrongTypesUnknownPropertiesAndDeclarationscallsApplicationTestcallsCommandHandlerTestcallsCommandLineTestcallsExecutorTest::testExecuteCheckFailsOnInvalidEvidencecallsExecutorTest::testExecuteCheckReadsLiveSourcescallsExecutorTest::testExecuteCheckReportsValidEvidencecallsExecutorTest::testExecuteCoverageAppliesTheThresholdOptionscallsExecutorTest::testExecuteCoverageRefusesASnapshotOfInvalidEvidencecallsExecutorTest::testExecuteCoverageReportsTheConfiguredModecallsExecutorTest::testExecuteCoverageReportsTheLiveModecallsExecutorTest::testExecuteCoverageWritesAndComparesASnapshotcallsExecutorTest::testExecuteFormatFailsTheCheckWhenADocumentNeedsFormattingcallsExecutorTest::testExecuteFormatReportsNoChangesForCanonicalDocumentscallsExecutorTest::testExecuteFormatRewritesDocumentsAndPassescallsExecutorTest::testExecuteLintCountsTheValidatedItemscallsExecutorTest::testExecuteRejectsAnUnknownCommandcallsExecutorTest::testExecuteSpecAcceptsEmptySelectionByDefaultcallsExecutorTest::testExecuteSpecListsRecordsWithoutRunningTestscallsExecutorTest::testExecuteSpecPassesOnlyWhenEveryItemPassescallsExecutorTest::testStrictSpecRequiresLinksEvenWithoutTestExecutioncallsFormatterTest::testFormatKeepsBundledSchemaDeclarationsAndEmptyMapscallsAnalyzerTest::testAnalyzeContinuesAfterAFailingScopecallsAnalyzerTest::testAnalyzeCountsUnitsSharedByScopesOncecallsAnalyzerTest::testAnalyzeFailsClosedOnInvalidEvidencecallsAnalyzerTest::testAnalyzeKeepsTheValidEvidenceOfAnItemThatClaimsNothingcallsAnalyzerTest::testAnalyzeNeedsASpecificationToClaimARequirementSharedAcrossDefinitionscallsAnalyzerTest::testAnalyzeRecordsScopesEvidenceAndClaimscallsAnalyzerTest::testAnalyzeRejectsEvidenceQuotingRepeatedUnitsAndCountsThemUncoveredcallsAnalyzerTest::testAnalyzeReportsAFailingSourceExtensionForTheScopeAndEveryEvidenceEntrycallsAnalyzerTest::testAnalyzeReportsAnEmptyScopeAsAnErrorAndNotAsFullCoveragecallsAnalyzerTest::testAnalyzeResolvesTheEvidenceOfItemsAfterAnItemWithoutSourcecallsAnalyzerTest::testAnalyzeUsesIndependentScopeAndReasonedDispositioncallsCoverageTest::testReportFailsTheDifferentialGateForANewUncoveredUnitcallsSnapshotTest::testCompareDetectsChangedClaimsNewUnitsAndRemovedScopecallsSnapshotTest::testCreateListsOnlyFingerprintsAndCompareDetectsDriftcallsSnapshotTest::testReadRejectsACoverageReportcallsVerifierTest::testVerifyDoesNotCountAZeroCaseSuccessAsAPassingTargetcallsVerifierTest::testVerifyRunsCustomSourcesAndRunnersThroughTheSamePipelineAndDeduplicatesTestscalls