classSourceUnit
final class SourceUnit
A unit in scope together with the specifications that claim it.
Properties§
public array<string, Item> $claims = []public Source $sourcepublic Unit $unitMethods§
public function supported(): boolTells whether a supported specification claims the unit.
Returns
bool True when at least one claim is supportedTest cases 3
Called from 1
public function fingerprint(array<string, Item> $items): stringFingerprints the unit text and the records of every claim and the requirements they refine.
Parameters
$items | array<string, Item> | Every item by ID |
Returns
string The SHA-256 hex digestThrows
JsonException When a record cannot be encodedTest cases 9
CoverageTest::testReportAppliesTheDifferentialThresholdToNewAndChangedUnitscallsCoverageTest::testReportRejectsRemovedUnitsUnlessAllowedcallsCoverageTest::testReportSkipsTheDifferentialThresholdWithoutChangedUnitscallsSnapshotTest::testCompareListsNewAndChangedUnitsAndRemovedKeyscallsSnapshotTest::testCreateListsTheFingerprintOfEveryUnitcallsSourceUnitTest::testFingerprintChangesWithTheRefinedRequirementRecordcallsSourceUnitTest::testFingerprintHashesClaimsAndRefinedRequirementsByIDcallsSourceUnitTest::testFingerprintHashesTheTextWithoutClaimscallsSourceUnitTest::testFingerprintIgnoresTheOrderOfClaimscalls
Called from 1
public function toArray(array<string, Item> $items): array<string, mixed>Returns the unit as a coverage report record.
Parameters
$items | array<string, Item> | Every item by ID |
Returns
array<string, mixed> The location, text, claims, status and fingerprintThrows
JsonException When a record cannot be encodedTest cases 4
Calls 3
- function-call
array_keysline 78 - method-call SourceUnit::supported() line 78
- method-call SourceUnit::fingerprint() line 78
Test cases 33§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 10
SourceUnitTest::testFingerprintChangesWithTheRefinedRequirementRecordcallsSourceUnitTest::testFingerprintHashesClaimsAndRefinedRequirementsByIDcallsSourceUnitTest::testFingerprintHashesTheTextWithoutClaimscallsSourceUnitTest::testFingerprintIgnoresTheOrderOfClaimscallsSourceUnitTest::testSupportedIsFalseWithOnlyUnsupportedClaimscallsSourceUnitTest::testSupportedIsFalseWithoutClaimscallsSourceUnitTest::testSupportedIsTrueWhenAnyClaimIsSupportedcallsSourceUnitTest::testToArrayReportsAnUncoveredUnitcallsSourceUnitTest::testToArrayReportsAnUnsupportedUnitcallsSourceUnitTest::testToArrayReportsASupportedUnitcalls
Other tests reaching this symbol 23
MarkdownDocumentTestcallsApplicationTestcallsCommandHandlerTestcallsExecutorTestcallsAnalysisTest::testSummaryCountsTheGivenUnitscallsAnalyzerTestcallsClaimsTest::testAssignKeepsOtherSpecificationsWhenOneIsInvalidcallsClaimsTest::testAssignLetsASpecificationClaimTheEvidenceOfTheRequirementsItRefinescallsClaimsTest::testAssignLetsNoRequirementClaimItsOwnEvidencecallsClaimsTest::testAssignOrdersTheUnitsByKeycallsClaimsTest::testAssignRecordsTheEvidenceOfASpecificationcallsClaimsTest::testAssignSkipsASpecificationRefiningARequirementWithInvalidEvidencecallsClaimsTest::testAssignSkipsASpecificationWithInvalidEvidencecallsCoverageTest::testReportAppliesTheDifferentialThresholdToNewAndChangedUnitscallsCoverageTest::testReportAppliesTheOverallThresholdcallsCoverageTest::testReportAppliesTheSourceThresholdscallsCoverageTest::testReportDescribesEveryUnitAndPassesWithoutGatescallsCoverageTest::testReportRejectsRemovedUnitsUnlessAllowedcallsCoverageTest::testReportSkipsTheDifferentialThresholdWithoutChangedUnitscallsSnapshotTest::testCompareListsNewAndChangedUnitsAndRemovedKeyscallsSnapshotTest::testCreateListsTheFingerprintOfEveryUnitcallsUnitCollectorTestcallsVerifierTestcalls