|
ILIAS
trunk Revision v13.0_alpha-62-g3b72d83f2e5
|
sync() computing the delta overlay: creation, admin edit, reconciling write (refresh), replace semantics. More...
Inheritance diagram for MigratedLanguageFileSyncDeltaTest:
Collaboration diagram for MigratedLanguageFileSyncDeltaTest:Public Member Functions | |
| testSyncingOnlyShippedValuesWritesNoOverlay (bool $refresh) | |
| A module whose values are all shipped ones needs no overlay: neither file, lock nor directory is created, by an admin edit or a reconciling write. More... | |
| testCreatingTheOverlayWithADeviatingValueRecordsShippedOriginalAndALocalChange () | |
| testCreatingTheOverlayGivesAnEntryWithoutShippedCounterpartNoOriginalButALocalChange () | |
| testCreatingTheOverlayKeepsShippedFuzzyOnlyForTheUnchangedShippedValue () | |
| A shipped "fuzzy" (an unreviewed value, usually the English fallback) must survive the very first sync as long as the value is still the shipped one - and must not be copied onto a value that differs from it. More... | |
| testTheDeltaIsComparedAgainstTheRawShippedValueNotTheMarkupCleanedOne () | |
The delta is compared against the RAW shipped .po value (TranslationCatalog::fromPoFile()), not the markup- cleaned value the build serves: a value with markup TranslationMarkupPolicy disallows is still the shipped value, so writing it back creates no delta. More... | |
| testTheOverlayTakesTheExtractedCommentsOfTheShippedEntry () | |
| Extracted comments ("#. ...", context for translators) are part of the shipped file and are carried into the overlay on creation/refresh. More... | |
| testTheOverlayTakesTheHeadersOfTheShippedPo () | |
| testAnAdminEditNeverMovesTheOriginal () | |
| refresh = false (an ordinary admin edit): the baseline "original" must never move - even when the shipped file changed in the meantime. More... | |
| testAnAdminEditRemovesFuzzyOnlyFromTheValuesItActuallyChanges () | |
| testWritingTheOriginalValueBackClearsTheLocalChange () | |
| testTheLocalChangeTimestampOfAnUntouchedEntrySurvivesAnUnrelatedWrite () | |
| A full-replace write re-sends every value; an entry whose value did not change must keep its existing local_change timestamp (seeded with a fixed, old value - no sleep()/clock needed). More... | |
| testALegacyEntryWithTheModuleAsMsgctxtIsMigratedToNoContextPreservingItsBookkeeping (bool $refresh) | |
| An overlay of an earlier version carried the module as msgctxt on every entry (see seedOverlay()); the next write must migrate it to the msgctxt-less shape (TranslationEntry::withContext(null)) while preserving translation, comments, flags, "local_change" and "original". More... | |
| testALegacyFullOverlayShrinksToTheDeltaOnTheNextReconcilingWrite () | |
| An overlay written by the pre-delta design carried EVERY entry of the module. More... | |
| testRefreshMovesTheOriginalToTheNewShippedValueAndClearsTheLocalChangeOfAnUnmodifiedEntry () | |
| testRefreshMovesTheOriginalButKeepsALocalCustomizationFlagged () | |
| testRefreshKeepsTheOriginalOfAnEntryTheShippedPoNoLongerContains () | |
An entry the shipped .po no longer contains (kept by the caller as a real local change, see LanguageInstallationManager::resolveMigratedModule()) keeps its last "original" and its local_change date - so a later update can still tell it from an unchanged entry. More... | |
| testRefreshRecomputesFuzzyFromTheShippedEntry (array $shipped, array $overlay, string $value, ?bool $expected_fuzzy) | |
| On refresh fuzzy is recomputed from the shipped file: set exactly when the value is the shipped value and the shipped entry is fuzzy. More... | |
| testReplaceSemanticsRemoveEveryEntryThatIsNotPassed () | |
| testSyncingNoEntriesRemovesTheOverlayButKeepsTheShippedFile () | |
| An empty delta removes the overlay files - the shipped file and the lock file are kept. More... | |
| testEntriesOfAnotherContextInTheOldOverlayAreNotCarriedOver () | |
| Entries of a different context (another module) are never taken over into this module's overlay: the overlay holds exactly $entries. More... | |
| testEntriesAreWrittenSortedByIdentifier () | |
| Sorted byte-wise by identifier, independent of the order of $entries - keeps the file diff-stable. More... | |
Static Public Member Functions | |
| static | refreshFlags () |
| static | refreshFuzzyCases () |
| static | refreshFlags () |
Additional Inherited Members | |
Protected Member Functions inherited from MigratedLanguageFileSyncTestCase | |
| setUp () | |
| tearDown () | |
| seedShipped (array $entries, string $lang_key='de', string $module=self::MODULE) | |
| seedOverlay (array $entries, string $lang_key='de') | |
| shippedPo (string $lang_key='de', string $module=self::MODULE) | |
| overlayBase (string $lang_key='de') | |
| overlayPo () | |
| sync (array $entries, bool $refresh=false, ?string $client_data_dir='default') | |
| overlayIdentifiers () | |
| overlayDirectory () | |
| findUnwritable (array $lang_keys=['de'], ?string $client_data_dir='default', ?LanguageFileDirectoryManager $manager=null) | |
Protected Attributes inherited from MigratedLanguageFileSyncTestCase | |
| const string | MODULE = 'stest' |
| string | $fixture_directory |
| string | $client_data_dir |
| string | $ilias_root |
| LanguageFileDirectory | $directory |
| LanguageFileDirectoryManager | $manager |
sync() computing the delta overlay: creation, admin edit, reconciling write (refresh), replace semantics.
Definition at line 34 of file MigratedLanguageFileSyncDeltaTest.php.
|
static |
Reimplemented from MigratedLanguageFileSyncTestCase.
Definition at line 55 of file MigratedLanguageFileSyncDeltaTest.php.
|
static |
Definition at line 368 of file MigratedLanguageFileSyncDeltaTest.php.
| MigratedLanguageFileSyncDeltaTest::testALegacyEntryWithTheModuleAsMsgctxtIsMigratedToNoContextPreservingItsBookkeeping | ( | bool | $refresh | ) |
An overlay of an earlier version carried the module as msgctxt on every entry (see seedOverlay()); the next write must migrate it to the msgctxt-less shape (TranslationEntry::withContext(null)) while preserving translation, comments, flags, "local_change" and "original".
Definition at line 236 of file MigratedLanguageFileSyncDeltaTest.php.
References MigratedPoFixture\catalog(), MigratedLanguageFileSyncTestCase\overlayBase(), MigratedLanguageFileSyncTestCase\overlayPo(), MigratedLanguageFileSyncTestCase\seedShipped(), MigratedLanguageFileSyncTestCase\sync(), and MigratedPoFixture\writePair().
Here is the call graph for this function:| MigratedLanguageFileSyncDeltaTest::testALegacyFullOverlayShrinksToTheDeltaOnTheNextReconcilingWrite | ( | ) |
An overlay written by the pre-delta design carried EVERY entry of the module.
The next reconciling write (Setup update) must shrink it to the true delta in one sync(): entries equal to the shipped value without local_change are dropped, a genuine local change survives - no dedicated migration step.
Definition at line 267 of file MigratedLanguageFileSyncDeltaTest.php.
References MigratedLanguageFileSyncTestCase\overlayIdentifiers(), MigratedLanguageFileSyncTestCase\overlayPo(), MigratedLanguageFileSyncTestCase\seedOverlay(), MigratedLanguageFileSyncTestCase\seedShipped(), and MigratedLanguageFileSyncTestCase\sync().
Here is the call graph for this function:| MigratedLanguageFileSyncDeltaTest::testAnAdminEditNeverMovesTheOriginal | ( | ) |
refresh = false (an ordinary admin edit): the baseline "original" must never move - even when the shipped file changed in the meantime.
Definition at line 157 of file MigratedLanguageFileSyncDeltaTest.php.
References MigratedLanguageFileSyncTestCase\overlayPo(), MigratedLanguageFileSyncTestCase\seedOverlay(), MigratedLanguageFileSyncTestCase\seedShipped(), and MigratedLanguageFileSyncTestCase\sync().
Here is the call graph for this function:| MigratedLanguageFileSyncDeltaTest::testAnAdminEditRemovesFuzzyOnlyFromTheValuesItActuallyChanges | ( | ) |
Definition at line 170 of file MigratedLanguageFileSyncDeltaTest.php.
References MigratedLanguageFileSyncTestCase\overlayPo(), MigratedLanguageFileSyncTestCase\seedOverlay(), MigratedLanguageFileSyncTestCase\seedShipped(), and MigratedLanguageFileSyncTestCase\sync().
Here is the call graph for this function:| MigratedLanguageFileSyncDeltaTest::testCreatingTheOverlayGivesAnEntryWithoutShippedCounterpartNoOriginalButALocalChange | ( | ) |
Definition at line 75 of file MigratedLanguageFileSyncDeltaTest.php.
References MigratedLanguageFileSyncTestCase\overlayPo(), MigratedLanguageFileSyncTestCase\seedShipped(), and MigratedLanguageFileSyncTestCase\sync().
Here is the call graph for this function:| MigratedLanguageFileSyncDeltaTest::testCreatingTheOverlayKeepsShippedFuzzyOnlyForTheUnchangedShippedValue | ( | ) |
A shipped "fuzzy" (an unreviewed value, usually the English fallback) must survive the very first sync as long as the value is still the shipped one - and must not be copied onto a value that differs from it.
Definition at line 92 of file MigratedLanguageFileSyncDeltaTest.php.
References MigratedLanguageFileSyncTestCase\overlayPo(), MigratedLanguageFileSyncTestCase\seedShipped(), and MigratedLanguageFileSyncTestCase\sync().
Here is the call graph for this function:| MigratedLanguageFileSyncDeltaTest::testCreatingTheOverlayWithADeviatingValueRecordsShippedOriginalAndALocalChange | ( | ) |
Definition at line 60 of file MigratedLanguageFileSyncDeltaTest.php.
References MigratedLanguageFileSyncTestCase\overlayPo(), MigratedLanguageFileSyncTestCase\seedShipped(), and MigratedLanguageFileSyncTestCase\sync().
Here is the call graph for this function:| MigratedLanguageFileSyncDeltaTest::testEntriesAreWrittenSortedByIdentifier | ( | ) |
Sorted byte-wise by identifier, independent of the order of $entries - keeps the file diff-stable.
SORT_STRING: upper case before lower case, "10" before "9".
Definition at line 434 of file MigratedLanguageFileSyncDeltaTest.php.
| MigratedLanguageFileSyncDeltaTest::testEntriesOfAnotherContextInTheOldOverlayAreNotCarriedOver | ( | ) |
Entries of a different context (another module) are never taken over into this module's overlay: the overlay holds exactly $entries.
Definition at line 416 of file MigratedLanguageFileSyncDeltaTest.php.
| MigratedLanguageFileSyncDeltaTest::testRefreshKeepsTheOriginalOfAnEntryTheShippedPoNoLongerContains | ( | ) |
An entry the shipped .po no longer contains (kept by the caller as a real local change, see LanguageInstallationManager::resolveMigratedModule()) keeps its last "original" and its local_change date - so a later update can still tell it from an unchanged entry.
Definition at line 322 of file MigratedLanguageFileSyncDeltaTest.php.
References MigratedLanguageFileSyncTestCase\overlayPo(), MigratedLanguageFileSyncTestCase\seedOverlay(), MigratedLanguageFileSyncTestCase\seedShipped(), and MigratedLanguageFileSyncTestCase\sync().
Here is the call graph for this function:| MigratedLanguageFileSyncDeltaTest::testRefreshMovesTheOriginalButKeepsALocalCustomizationFlagged | ( | ) |
Definition at line 302 of file MigratedLanguageFileSyncDeltaTest.php.
References MigratedLanguageFileSyncTestCase\overlayPo(), MigratedLanguageFileSyncTestCase\seedOverlay(), MigratedLanguageFileSyncTestCase\seedShipped(), and MigratedLanguageFileSyncTestCase\sync().
Here is the call graph for this function:| MigratedLanguageFileSyncDeltaTest::testRefreshMovesTheOriginalToTheNewShippedValueAndClearsTheLocalChangeOfAnUnmodifiedEntry | ( | ) |
Definition at line 287 of file MigratedLanguageFileSyncDeltaTest.php.
References MigratedLanguageFileSyncTestCase\overlayBase(), MigratedLanguageFileSyncTestCase\seedOverlay(), MigratedLanguageFileSyncTestCase\seedShipped(), and MigratedLanguageFileSyncTestCase\sync().
Here is the call graph for this function:| MigratedLanguageFileSyncDeltaTest::testRefreshRecomputesFuzzyFromTheShippedEntry | ( | array | $shipped, |
| array | $overlay, | ||
| string | $value, | ||
| ?bool | $expected_fuzzy | ||
| ) |
On refresh fuzzy is recomputed from the shipped file: set exactly when the value is the shipped value and the shipped entry is fuzzy.
| array<string,mixed> | $shipped |
| array<string,mixed> | $overlay |
Definition at line 345 of file MigratedLanguageFileSyncDeltaTest.php.
| MigratedLanguageFileSyncDeltaTest::testReplaceSemanticsRemoveEveryEntryThatIsNotPassed | ( | ) |
Definition at line 383 of file MigratedLanguageFileSyncDeltaTest.php.
References MigratedPoFixture\overlayMo(), and MigratedPoFixture\readMo().
Here is the call graph for this function:| MigratedLanguageFileSyncDeltaTest::testSyncingNoEntriesRemovesTheOverlayButKeepsTheShippedFile | ( | ) |
An empty delta removes the overlay files - the shipped file and the lock file are kept.
Definition at line 399 of file MigratedLanguageFileSyncDeltaTest.php.
References MigratedPoFixture\overlayLock(), MigratedPoFixture\overlayMo(), and MigratedPoFixture\readPo().
Here is the call graph for this function:| MigratedLanguageFileSyncDeltaTest::testSyncingOnlyShippedValuesWritesNoOverlay | ( | bool | $refresh | ) |
A module whose values are all shipped ones needs no overlay: neither file, lock nor directory is created, by an admin edit or a reconciling write.
Definition at line 41 of file MigratedLanguageFileSyncDeltaTest.php.
References MigratedLanguageFileSyncTestCase\overlayBase(), MigratedPoFixture\overlayLock(), MigratedPoFixture\overlayMo(), MigratedLanguageFileSyncTestCase\seedShipped(), MigratedLanguageFileSyncTestCase\shippedPo(), and MigratedLanguageFileSyncTestCase\sync().
Here is the call graph for this function:| MigratedLanguageFileSyncDeltaTest::testTheDeltaIsComparedAgainstTheRawShippedValueNotTheMarkupCleanedOne | ( | ) |
The delta is compared against the RAW shipped .po value (TranslationCatalog::fromPoFile()), not the markup- cleaned value the build serves: a value with markup TranslationMarkupPolicy disallows is still the shipped value, so writing it back creates no delta.
Definition at line 115 of file MigratedLanguageFileSyncDeltaTest.php.
References MigratedLanguageFileSyncTestCase\overlayBase(), MigratedLanguageFileSyncTestCase\seedShipped(), and MigratedLanguageFileSyncTestCase\sync().
Here is the call graph for this function:| MigratedLanguageFileSyncDeltaTest::testTheLocalChangeTimestampOfAnUntouchedEntrySurvivesAnUnrelatedWrite | ( | ) |
A full-replace write re-sends every value; an entry whose value did not change must keep its existing local_change timestamp (seeded with a fixed, old value - no sleep()/clock needed).
Definition at line 213 of file MigratedLanguageFileSyncDeltaTest.php.
References MigratedLanguageFileSyncTestCase\overlayPo(), MigratedLanguageFileSyncTestCase\seedOverlay(), MigratedLanguageFileSyncTestCase\seedShipped(), and MigratedLanguageFileSyncTestCase\sync().
Here is the call graph for this function:| MigratedLanguageFileSyncDeltaTest::testTheOverlayTakesTheExtractedCommentsOfTheShippedEntry | ( | ) |
Extracted comments ("#. ...", context for translators) are part of the shipped file and are carried into the overlay on creation/refresh.
Definition at line 128 of file MigratedLanguageFileSyncDeltaTest.php.
References MigratedPoFixture\catalog(), MigratedLanguageFileSyncTestCase\overlayPo(), MigratedLanguageFileSyncTestCase\shippedPo(), MigratedLanguageFileSyncTestCase\sync(), and MigratedPoFixture\writePo().
Here is the call graph for this function:| MigratedLanguageFileSyncDeltaTest::testTheOverlayTakesTheHeadersOfTheShippedPo | ( | ) |
Definition at line 139 of file MigratedLanguageFileSyncDeltaTest.php.
References MigratedPoFixture\catalog(), MigratedLanguageFileSyncTestCase\overlayPo(), MigratedLanguageFileSyncTestCase\shippedPo(), MigratedLanguageFileSyncTestCase\sync(), and MigratedPoFixture\writePo().
Here is the call graph for this function:| MigratedLanguageFileSyncDeltaTest::testWritingTheOriginalValueBackClearsTheLocalChange | ( | ) |
Definition at line 189 of file MigratedLanguageFileSyncDeltaTest.php.
References MigratedLanguageFileSyncTestCase\overlayBase(), MigratedPoFixture\overlayMo(), MigratedLanguageFileSyncTestCase\seedOverlay(), MigratedLanguageFileSyncTestCase\seedShipped(), and MigratedLanguageFileSyncTestCase\sync().
Here is the call graph for this function: