|
ILIAS
trunk Revision v13.0_alpha-62-g3b72d83f2e5
|
sync() and the overlay files: no-op guard, self-healing .mo, cache invalidation, value "0", multi-line originals. More...
Inheritance diagram for MigratedLanguageFileSyncOverlayFilesTest:
Collaboration diagram for MigratedLanguageFileSyncOverlayFilesTest:Public Member Functions | |
| testAnUnchangedOverlayWithACorrectMoWritesNothing (bool $refresh) | |
No-op guard: an unchanged .po next to a .mo equal to what TranslationCatalog::toMoString() compiles writes nothing: no file is replaced (AtomicFileWriter renames, so a rewrite changes the inode) and the read cache is not invalidated. More... | |
| testAMissingMoIsRecompiledEvenWhenThePoIsUnchanged () | |
| testAStaleMoNextToAnUnchangedPoIsRebuilt (\Closure $stale_content, bool $refresh) | |
Self-healing: a .mo that does not hold exactly what TranslationCatalog::toMoString() compiles from the (unchanged) .po - garbage, truncated, empty, or the compiled content of another catalog - is rebuilt, byte for byte, although the .po itself is left untouched. More... | |
| testAChangedValueRewritesBothFiles () | |
| testANewOverlayEntryTakesItsLocalChangeDateFromTheGivenDates () | |
| An entry that enters the overlay with a write that knows when it was changed locally (setup update: lng_data.local_change) keeps that time - not the time of the write. More... | |
| testASyncInvalidatesTheIlLanguageReadCache () | |
| testTheValueZeroSurvivesTheSyncAndResyncingIsANoOp () | |
gettext/gettext treats a falsy translation as absent; the adapter's workaround must hold on the whole way through sync(): "0" (it occurs in the legacy ilias_fr.lang/ilias_pl.lang) is written as msgstr "0", served from the .mo as "0", is no local change when shipped that way - and re-syncing it is a no-op (the .mo byte comparison must see identical output). More... | |
| testAValueChangedToZeroIsALocalChangeAndServedAsZero () | |
| testAnUnchangedMultiLineShippedValueIsNoLocalChangeAndResyncingIsANoOp () | |
| A shipped value with line breaks or backslashes is stored as "original" losslessly: re-syncing it is no local change, neither on creation nor on a reconciling write, and produces byte-identical files. More... | |
| testChangingOnlyTheLineBreakOfAMultiLineValueIsALocalChange () | |
| testAReconcilingWriteRepairsALegacyFlattenedOriginal () | |
| An overlay written by an earlier version has the multi-line original flattened into spaces - a reconciling write (refresh) replaces it by the losslessly escaped shipped value and clears the resulting false local change. More... | |
| testALegacyOriginalWithABackslashIsReadVerbatimByAnAdminEdit () | |
| An "original: " comment of the legacy format containing a backslash is read verbatim: an admin edit of another entry keeps the untouched entry unchanged and not locally changed. More... | |
| testLoadModuleTranslationsReturnsTheDecodedMultiLineOriginal () | |
| testRefreshKeepsAnEscapedOriginalOfAnEntryTheShippedPoNoLongerContains () | |
Static Public Member Functions | |
| static | staleMoContents () |
Static Public Member Functions inherited from MigratedLanguageFileSyncTestCase | |
| 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() and the overlay files: no-op guard, self-healing .mo, cache invalidation, value "0", multi-line originals.
Definition at line 34 of file MigratedLanguageFileSyncOverlayFilesTest.php.
|
static |
Definition at line 125 of file MigratedLanguageFileSyncOverlayFilesTest.php.
References MigratedPoFixture\catalog().
Here is the call graph for this function:| MigratedLanguageFileSyncOverlayFilesTest::testAChangedValueRewritesBothFiles | ( | ) |
Definition at line 140 of file MigratedLanguageFileSyncOverlayFilesTest.php.
References MigratedLanguageFileSyncTestCase\overlayBase(), MigratedPoFixture\overlayMo(), MigratedPoFixture\readMo(), MigratedLanguageFileSyncTestCase\seedShipped(), and MigratedLanguageFileSyncTestCase\sync().
Here is the call graph for this function:| MigratedLanguageFileSyncOverlayFilesTest::testALegacyOriginalWithABackslashIsReadVerbatimByAnAdminEdit | ( | ) |
An "original: " comment of the legacy format containing a backslash is read verbatim: an admin edit of another entry keeps the untouched entry unchanged and not locally changed.
Definition at line 301 of file MigratedLanguageFileSyncOverlayFilesTest.php.
References MigratedPoFixture\catalog(), MigratedLanguageFileSyncTestCase\overlayBase(), MigratedLanguageFileSyncTestCase\overlayPo(), MigratedLanguageFileSyncTestCase\seedShipped(), MigratedLanguageFileSyncTestCase\sync(), and MigratedPoFixture\writePair().
Here is the call graph for this function:| MigratedLanguageFileSyncOverlayFilesTest::testAMissingMoIsRecompiledEvenWhenThePoIsUnchanged | ( | ) |
Definition at line 67 of file MigratedLanguageFileSyncOverlayFilesTest.php.
References MigratedLanguageFileSyncTestCase\overlayBase(), MigratedPoFixture\overlayMo(), MigratedPoFixture\readMo(), MigratedLanguageFileSyncTestCase\seedShipped(), and MigratedLanguageFileSyncTestCase\sync().
Here is the call graph for this function:| MigratedLanguageFileSyncOverlayFilesTest::testANewOverlayEntryTakesItsLocalChangeDateFromTheGivenDates | ( | ) |
An entry that enters the overlay with a write that knows when it was changed locally (setup update: lng_data.local_change) keeps that time - not the time of the write.
An entry already in the overlay keeps its own bookkeeping.
Definition at line 157 of file MigratedLanguageFileSyncOverlayFilesTest.php.
References MigratedLanguageFileSyncTestCase\overlayPo(), and MigratedLanguageFileSyncTestCase\seedShipped().
Here is the call graph for this function:| MigratedLanguageFileSyncOverlayFilesTest::testAnUnchangedMultiLineShippedValueIsNoLocalChangeAndResyncingIsANoOp | ( | ) |
A shipped value with line breaks or backslashes is stored as "original" losslessly: re-syncing it is no local change, neither on creation nor on a reconciling write, and produces byte-identical files.
Definition at line 242 of file MigratedLanguageFileSyncOverlayFilesTest.php.
References MigratedLanguageFileSyncTestCase\overlayBase(), MigratedLanguageFileSyncTestCase\seedShipped(), and MigratedLanguageFileSyncTestCase\sync().
Here is the call graph for this function:| MigratedLanguageFileSyncOverlayFilesTest::testAnUnchangedOverlayWithACorrectMoWritesNothing | ( | bool | $refresh | ) |
No-op guard: an unchanged .po next to a .mo equal to what TranslationCatalog::toMoString() compiles writes nothing: no file is replaced (AtomicFileWriter renames, so a rewrite changes the inode) and the read cache is not invalidated.
Definition at line 42 of file MigratedLanguageFileSyncOverlayFilesTest.php.
References MigratedLanguageFileSyncTestCase\overlayBase(), MigratedPoFixture\overlayMo(), MigratedLanguageFileSyncTestCase\seedShipped(), and MigratedLanguageFileSyncTestCase\sync().
Here is the call graph for this function:| MigratedLanguageFileSyncOverlayFilesTest::testAReconcilingWriteRepairsALegacyFlattenedOriginal | ( | ) |
An overlay written by an earlier version has the multi-line original flattened into spaces - a reconciling write (refresh) replaces it by the losslessly escaped shipped value and clears the resulting false local change.
Definition at line 277 of file MigratedLanguageFileSyncOverlayFilesTest.php.
References MigratedPoFixture\catalog(), MigratedLanguageFileSyncTestCase\overlayBase(), MigratedLanguageFileSyncTestCase\seedShipped(), MigratedLanguageFileSyncTestCase\sync(), and MigratedPoFixture\writePair().
Here is the call graph for this function:| MigratedLanguageFileSyncOverlayFilesTest::testAStaleMoNextToAnUnchangedPoIsRebuilt | ( | \Closure | $stale_content, |
| bool | $refresh | ||
| ) |
Self-healing: a .mo that does not hold exactly what TranslationCatalog::toMoString() compiles from the (unchanged) .po - garbage, truncated, empty, or the compiled content of another catalog - is rebuilt, byte for byte, although the .po itself is left untouched.
ilLanguage serves the .mo, so without this a broken .mo would be served until the next actual value change.
Definition at line 93 of file MigratedLanguageFileSyncOverlayFilesTest.php.
References MigratedLanguageFileSyncTestCase\overlayBase(), MigratedPoFixture\overlayMo(), MigratedPoFixture\readMo(), MigratedPoFixture\readPo(), MigratedLanguageFileSyncTestCase\seedShipped(), and MigratedLanguageFileSyncTestCase\sync().
Here is the call graph for this function:| MigratedLanguageFileSyncOverlayFilesTest::testASyncInvalidatesTheIlLanguageReadCache | ( | ) |
Definition at line 179 of file MigratedLanguageFileSyncOverlayFilesTest.php.
References MigratedLanguageFileSyncTestCase\seedShipped(), and MigratedLanguageFileSyncTestCase\sync().
Here is the call graph for this function:| MigratedLanguageFileSyncOverlayFilesTest::testAValueChangedToZeroIsALocalChangeAndServedAsZero | ( | ) |
Definition at line 224 of file MigratedLanguageFileSyncOverlayFilesTest.php.
References MigratedLanguageFileSyncTestCase\overlayBase(), MigratedPoFixture\overlayMo(), MigratedLanguageFileSyncTestCase\overlayPo(), MigratedPoFixture\readMo(), MigratedLanguageFileSyncTestCase\seedShipped(), and MigratedLanguageFileSyncTestCase\sync().
Here is the call graph for this function:| MigratedLanguageFileSyncOverlayFilesTest::testChangingOnlyTheLineBreakOfAMultiLineValueIsALocalChange | ( | ) |
Definition at line 260 of file MigratedLanguageFileSyncOverlayFilesTest.php.
References MigratedLanguageFileSyncTestCase\overlayPo(), MigratedLanguageFileSyncTestCase\seedShipped(), and MigratedLanguageFileSyncTestCase\sync().
Here is the call graph for this function:| MigratedLanguageFileSyncOverlayFilesTest::testLoadModuleTranslationsReturnsTheDecodedMultiLineOriginal | ( | ) |
Definition at line 318 of file MigratedLanguageFileSyncOverlayFilesTest.php.
References MigratedLanguageFileSyncTestCase\seedOverlay(), and MigratedLanguageFileSyncTestCase\seedShipped().
Here is the call graph for this function:| MigratedLanguageFileSyncOverlayFilesTest::testRefreshKeepsAnEscapedOriginalOfAnEntryTheShippedPoNoLongerContains | ( | ) |
Definition at line 329 of file MigratedLanguageFileSyncOverlayFilesTest.php.
References MigratedLanguageFileSyncTestCase\overlayPo(), MigratedLanguageFileSyncTestCase\seedOverlay(), MigratedLanguageFileSyncTestCase\seedShipped(), and MigratedLanguageFileSyncTestCase\sync().
Here is the call graph for this function:| MigratedLanguageFileSyncOverlayFilesTest::testTheValueZeroSurvivesTheSyncAndResyncingIsANoOp | ( | ) |
gettext/gettext treats a falsy translation as absent; the adapter's workaround must hold on the whole way through sync(): "0" (it occurs in the legacy ilias_fr.lang/ilias_pl.lang) is written as msgstr "0", served from the .mo as "0", is no local change when shipped that way - and re-syncing it is a no-op (the .mo byte comparison must see identical output).
Definition at line 200 of file MigratedLanguageFileSyncOverlayFilesTest.php.
References MigratedLanguageFileSyncTestCase\overlayBase(), MigratedPoFixture\overlayMo(), MigratedLanguageFileSyncTestCase\overlayPo(), MigratedPoFixture\readMo(), MigratedLanguageFileSyncTestCase\seedShipped(), and MigratedLanguageFileSyncTestCase\sync().
Here is the call graph for this function: