ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
LanguageInstallationManagerMigratedModulesTestCase Class Reference

Fixtures of the LanguageInstallationManager tests for modules migrated to PO/MO ("pilot"). More...

+ Inheritance diagram for LanguageInstallationManagerMigratedModulesTestCase:
+ Collaboration diagram for LanguageInstallationManagerMigratedModulesTestCase:

Protected Member Functions

 setUp ()
 
 tearDown ()
 
 db ()
 
 repository ()
 
 manager (?\Closure $client_data_dir_resolver=null, ?\Closure $language_cache_invalidator=null, bool $with_resolver=true, bool $with_logger=true, ?LoggerInterface $logger=null)
 
 expectManagerWarning ()
 
 assertPostConditions ()
 
 loggedWarnings ()
 
 shipPo (array $entries, string $lang_key='de')
 
 shipSecondModule (array $entries)
 A second migrated module "pilot2" next to "pilot". More...
 
 seedOverlay (array $entries)
 
 overlayBase ()
 
 overlayPo ()
 
 effective ()
 Shipped .po plus overlay delta, as served (MigratedLanguageFileSync::loadModuleTranslations()) - the overlay itself only holds the entries that differ from the shipped .po. More...
 
 writeLang (string $relative_file, array $lines)
 
 resolveToken (string $token)
 
 lngData ()
 
 applyLngDataDelete (string $query, array $rows)
 Applies one recorded "DELETE FROM lng_data" to $rows, in the two shapes LanguageInstallationManager issues: the bulk delete of unchanged rows of a migrated module ("... local_change IS NULL AND module IN (...)") and the per-module delete of dropped identifiers ("... AND module = ? AND identifier IN (...)"). More...
 
 droppedIdentifiers (string $module)
 Identifiers of $module dropped via the per-module "DELETE FROM lng_data ... AND identifier IN (...)", as opposed to keys merely absent because they were never touched. More...
 
 lngModules ()
 
 errorLog ()
 What error_log() wrote during this test so far - PHPUnit redirects error_log to a capture file per test (call expectErrorLog() in tests that expect logging, so it is not echoed). More...
 
 shipPluralPo (array $entries, string $header)
 
 writeLocalOverlay (array $flat_values)
 
 seedOverlayMarkedAsMerged (array $entries, array $merged)
 

Protected Attributes

const string NOW = '2026-01-02 03:04:05'
 
const string MODULE = 'pilot'
 
string $root
 
LanguageFileDirectory $directory
 
array $further_directories = []
 
array $quoted = []
 
array $queries = []
 
array $collation_rows = null
 
array $pending_rows = []
 
array $duplicate_rows = []
 
array $local_change_rows = []
 
array $db_local_changes = []
 
array $db_entries = []
 
array $available_languages = []
 
array $logged_warnings = []
 
const string TWO_FORMS = 'nplurals=2; plural=(n != 1);'
 
const string THREE_FORMS = 'nplurals=3; plural=(n == 1 ? 0 : n >= 2 && n <= 4 ? 1 : 2);'
 

Private Member Functions

 recordingLogger ()
 

Private Attributes

bool $expects_manager_warning = false
 

Detailed Description

Fixtures of the LanguageInstallationManager tests for modules migrated to PO/MO ("pilot").

The database is a recording mock: quote() hands out placeholder tokens and remembers the real values, so the written lng_data rows (including a NULL local_change) and lng_modules arrays can be asserted as data instead of as SQL strings.

Definition at line 42 of file LanguageInstallationManagerMigratedModulesTestCase.php.

Member Function Documentation

◆ applyLngDataDelete()

LanguageInstallationManagerMigratedModulesTestCase::applyLngDataDelete ( string  $query,
array  $rows 
)
protected

Applies one recorded "DELETE FROM lng_data" to $rows, in the two shapes LanguageInstallationManager issues: the bulk delete of unchanged rows of a migrated module ("... local_change IS NULL AND module IN (...)") and the per-module delete of dropped identifiers ("... AND module = ? AND identifier IN (...)").

Both use $ilDB->in(), whose stub embeds the raw values literally instead of quote() tokens.

Parameters
array<string,array{valuestring, local_change: ?string}> $rows
Returns
array<string, array{value: string, local_change: ?string}>

Definition at line 317 of file LanguageInstallationManagerMigratedModulesTestCase.php.

317 : array
318 {
319 // the purge after "apply local changes" wrote a migrated module: its unchanged rows that
320 // were not written
321 if (preg_match(
322 '/^DELETE FROM lng_data WHERE lang_key = Q\d+Q AND local_change IS NULL AND module = (Q\d+Q)(?: AND identifier NOT IN \‍(\'(.*)\'\‍))?$/',
323 $query,
324 $matches
325 ) === 1) {
326 $module = $this->resolveToken($matches[1]);
327 $written = isset($matches[2]) ? explode("','", $matches[2]) : [];
328 foreach ($rows as $key => $row) {
329 [$row_module, $identifier] = explode('|', $key, 2);
330 if ($row_module === $module && $row['local_change'] === null && !in_array($identifier, $written, true)) {
331 unset($rows[$key]);
332 }
333 }
334 return $rows;
335 }
336
337 if (preg_match(
338 '/^DELETE FROM lng_data WHERE lang_key = Q\d+Q AND local_change IS NULL AND module IN \‍(\'(.*)\'\‍)$/',
339 $query,
340 $matches
341 ) === 1) {
342 $modules = explode("','", $matches[1]);
343 foreach ($rows as $key => $row) {
344 [$module] = explode('|', $key, 2);
345 if (in_array($module, $modules, true) && $row['local_change'] === null) {
346 unset($rows[$key]);
347 }
348 }
349 return $rows;
350 }
351
352 if (preg_match(
353 '/^DELETE FROM lng_data WHERE lang_key = Q\d+Q AND module = (Q\d+Q) AND identifier IN \‍(\'(.*)\'\‍)$/',
354 $query,
355 $matches
356 ) === 1) {
357 $module = $this->resolveToken($matches[1]);
358 foreach (explode("','", $matches[2]) as $identifier) {
359 unset($rows[$module . '|' . $identifier]);
360 }
361 return $rows;
362 }
363
364 return $rows;
365 }
if(!isset($arguments[0])) if(count( $arguments) > 3) if(! $remove_from_lang &&isset($arguments[2]) &&!is_dir($arguments[2])) $module
if(! $all_ok) if(!is_dir($output_dir) &&! @mkdir($output_dir, 0775, true) &&!is_dir($output_dir)) $written

References $module, ILIAS\Scripts\PHPStan\$rows, and $written.

◆ assertPostConditions()

LanguageInstallationManagerMigratedModulesTestCase::assertPostConditions ( )
protected

Definition at line 199 of file LanguageInstallationManagerMigratedModulesTestCase.php.

199 : void
200 {
201 parent::assertPostConditions();
202 if ($this->expects_manager_warning) {
203 $this->assertNotSame([], $this->logged_warnings, 'the manager logged no warning');
204 }
205 }

◆ db()

LanguageInstallationManagerMigratedModulesTestCase::db ( )
protected

Definition at line 93 of file LanguageInstallationManagerMigratedModulesTestCase.php.

94 {
95 $statement = $this->createStub(ilDBStatement::class);
96 $db = $this->createStub(ilDBInterface::class);
97 $db->method('quote')->willReturnCallback(function (mixed $value, string $type): string {
98 $this->quoted[] = $value;
99 return 'Q' . (count($this->quoted) - 1) . 'Q';
100 });
101 $db->method('in')->willReturnCallback(
102 static fn(string $field, array $values, bool $negate = false): string =>
103 $field . ($negate ? " NOT IN ('" : " IN ('") . implode("','", $values) . "')"
104 );
105 // the "apply local changes" write runs under a table lock: the callable runs right away
106 $db->method('buildAtomQuery')->willReturnCallback(function () use ($db): ilAtomQuery {
107 $atom_query = $this->createStub(ilAtomQuery::class);
108 $atom_query->method('addQueryCallable')->willReturnCallback(
109 static function (callable $query) use ($db): void {
110 $query($db);
111 }
112 );
113 return $atom_query;
114 });
115 $db->method('manipulate')->willReturnCallback(function (string $query): int {
116 $this->queries[] = $query;
117 return 1;
118 });
119 $db->method('query')->willReturnCallback(function (string $query) use ($statement): ilDBStatement {
120 $this->queries[] = $query;
121 if (str_starts_with($query, 'SELECT module, identifier, local_change FROM lng_data')) {
122 $this->pending_rows = $this->local_change_rows;
123 return $statement;
124 }
125 if (str_starts_with($query, 'SELECT DISTINCT module, identifier FROM lng_data')) {
126 $this->pending_rows = $this->duplicate_rows;
127 return $statement;
128 }
129 $this->pending_rows = $this->collation_rows ?? array_map(
130 static fn(string $module, array $lang_array): array => ['module' => $module, 'lang_array' => serialize($lang_array)],
131 array_keys($this->lngModules()),
132 $this->lngModules()
133 );
134 return $statement;
135 });
136 $db->method('fetchAssoc')->willReturnCallback(fn(): ?array => array_shift($this->pending_rows));
137 $db->method('now')->willReturn('NOW()');
138 $db->method('nextId')->willReturn(1);
139
140 return $db;
141 }
Interface ilAtomQuery Use ilAtomQuery to fire Database-Actions which have to be done without beeing i...
Definition: ilAtomQuery.php:28
Interface ilDBInterface.
Interface ilDBStatement.

References $duplicate_rows, $local_change_rows, $module, and lngModules().

Referenced by LanguageInstallationManagerMigratedSourcesAndLocksTest\testLocksAreAcquiredInSortedOrderRegardlessOfTheContributedDirectoryOrder().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ droppedIdentifiers()

LanguageInstallationManagerMigratedModulesTestCase::droppedIdentifiers ( string  $module)
protected

Identifiers of $module dropped via the per-module "DELETE FROM lng_data ... AND identifier IN (...)", as opposed to keys merely absent because they were never touched.

Returns
list<string>

Definition at line 373 of file LanguageInstallationManagerMigratedModulesTestCase.php.

373 : array
374 {
375 $dropped = [];
376 foreach ($this->queries as $query) {
377 if (
378 preg_match(
379 '/^DELETE FROM lng_data WHERE lang_key = Q\d+Q AND module = (Q\d+Q) AND identifier IN \‍(\'(.*)\'\‍)$/',
380 $query,
381 $matches
382 ) === 1
383 && $this->resolveToken($matches[1]) === $module
384 ) {
385 $dropped = array_merge($dropped, explode("','", $matches[2]));
386 }
387 }
388
389 return $dropped;
390 }

References $module.

Referenced by LanguageInstallationManagerMigratedDroppedKeysTest\testACustomizingValueForAKeyDroppedFromTheShippedPoStaysLocal(), LanguageInstallationManagerMigratedDroppedKeysTest\testAKeyDroppedFromTheShippedPoButWithARealLocalChangeIsKept(), LanguageInstallationManagerMigratedDroppedKeysTest\testAKeyDroppedFromTheShippedPoWithACorruptOverlayLeavesItsModuleUnchanged(), and LanguageInstallationManagerMigratedDroppedKeysTest\testAKeyDroppedFromTheShippedPoWithoutALocalChangeInTheOverlayIsRemoved().

+ Here is the caller graph for this function:

◆ effective()

LanguageInstallationManagerMigratedModulesTestCase::effective ( )
protected

Shipped .po plus overlay delta, as served (MigratedLanguageFileSync::loadModuleTranslations()) - the overlay itself only holds the entries that differ from the shipped .po.

Returns
array<string, array{value: string, local_change: bool, local_change_date: ?string, original: ?string}>

Definition at line 258 of file LanguageInstallationManagerMigratedModulesTestCase.php.

258 : array
259 {
260 return MigratedLanguageFileSync::loadModuleTranslations(
262 'de',
263 self::MODULE,
264 $this->root . '/client-data',
265 $this->root
266 ) ?? [];
267 }

Referenced by LanguageInstallationManagerMigratedTakeOverTest\testALocalChangeOfTheOverlayOverrulesTheCustomizingFileUnlessItIsOlder(), LanguageInstallationManagerMigratedTakeOverTest\testAModuleRecordedWithoutAnOverlayNeverReadsLngDataAgain(), LanguageInstallationManagerMigratedPluralFormsTest\testAnExistingOverlayIsServedWithItsOwnRuleUntilTheNextReconcilingWrite(), LanguageInstallationManagerMigratedTakeOverTest\testAnUnusableRecordCountsAsEmptyAndTheRowsAreTakenOverAgain(), LanguageInstallationManagerMigratedTakeOverTest\testAReadableOverlayWithoutTheRecordWinsOverLngData(), LanguageInstallationManagerMigratedDroppedKeysTest\testAWholeMissingShippedPoIsBridgedByThePreservedOverlayAcrossTwoUpdates(), LanguageInstallationManagerMigratedSourcesAndLocksTest\testInstallWithoutLocalChangesWritesNoOverlayOnlyTheTakenOverRecord(), LanguageInstallationManagerMigratedLocalChangesActionsTest\testRemovingLocalChangesRebuildsTheOverlayFromTheShippedPo(), LanguageInstallationManagerMigratedTakeOverTest\testTheLngDataLocalChangesAreTakenOverOnceAndNeverReadAgain(), and LanguageInstallationManagerMigratedTakeOverTest\testUninstallingTheLanguageForgetsTheRecordAndAReinstallTakesTheRowsOverAgain().

+ Here is the caller graph for this function:

◆ errorLog()

LanguageInstallationManagerMigratedModulesTestCase::errorLog ( )
protected

What error_log() wrote during this test so far - PHPUnit redirects error_log to a capture file per test (call expectErrorLog() in tests that expect logging, so it is not echoed).

Definition at line 415 of file LanguageInstallationManagerMigratedModulesTestCase.php.

415 : string
416 {
417 $file = (string) ini_get('error_log');
418 return $file !== '' && is_file($file) ? (string) file_get_contents($file) : '';
419 }

Referenced by LanguageInstallationManagerMigratedAfterWriteTest\testAThrowingLoggerFallsBackToThePhpErrorLogAndDoesNotAbortTheInstallation(), LanguageInstallationManagerMigratedPluralFormsTest\testInstallAfterTheNumberOfPluralFormsShrankKeepsTheLocalDefaultFormAndLogsTheLostValue(), and LanguageInstallationManagerMigratedAfterWriteTest\testWithoutALoggerAWarningGoesToThePhpErrorLog().

+ Here is the caller graph for this function:

◆ expectManagerWarning()

LanguageInstallationManagerMigratedModulesTestCase::expectManagerWarning ( )
protected

Definition at line 194 of file LanguageInstallationManagerMigratedModulesTestCase.php.

194 : void
195 {
196 $this->expects_manager_warning = true;
197 }

Referenced by LanguageInstallationManagerDuplicateIdentifiersTest\testACustomizingEntryWhoseIdentifierExistsInAnotherModuleIsSkippedButTheRestIsInstalled(), LanguageInstallationManagerMigratedAfterWriteTest\testADuplicateInOneFileKeepsTheFirstOccurrenceAndIsReported(), LanguageInstallationManagerMigratedAfterWriteTest\testAFailingCacheInvalidatorIsLoggedAndSwallowed(), LanguageInstallationManagerMigratedTakeOverTest\testAfterTheRepairTheNextRunInstallsTheModuleAndEmptiesTheSkipList(), LanguageInstallationManagerMigratedDroppedKeysTest\testAKeyDroppedFromTheShippedPoWithACorruptOverlayLeavesItsModuleUnchanged(), LanguageInstallationManagerMigratedTakeOverTest\testAModuleWhoseOverlayCouldNotBeWrittenIsNotRecorded(), LanguageInstallationManagerMigratedUnshippedOverlaysTest\testAModuleWhoseTakeOverCouldNotBeRecordedIsReportedUntilItIsRecorded(), LanguageInstallationManagerDuplicateIdentifiersTest\testAModuleWithADuplicateCustomizingEntryIsNotRecordedUntilItIsFixed(), LanguageInstallationManagerMigratedTakeOverTest\testAModuleWithAMarkupRejectedCustomizingEntryIsNotRecordedUntilItIsFixed(), LanguageInstallationManagerMigratedTakeOverTest\testAModuleWithAnUnreadableOverlayIsLeftOutAndTheOthersAreInstalledNormally(), LanguageInstallationManagerMigratedSourcesAndLocksTest\testAModuleWithoutAnOverlayThatGetsOneCreatedDuringTheRunIsReportedAndTheOverlaySurvives(), LanguageInstallationManagerMigratedAfterWriteTest\testAnOverlaySyncFailureIsLoggedAndTheDatabaseWriteStays(), LanguageInstallationManagerDuplicateIdentifiersTest\testEntriesOfTheSameRunCountAsExisting(), LanguageInstallationManagerMigratedAfterWriteTest\testEveryWritePathReturnsOnlyTheModulesWhoseOverlayCouldNotBeWritten(), LanguageInstallationManagerMigratedUnshippedOverlaysTest\testOnlyModulesWithLocalChangesNotYetInTheRecordAreReportedAsUnrecorded(), and LanguageInstallationManagerDuplicateIdentifiersTest\testTheSkippedDuplicatesAreResetOnEveryInsertLanguageCall().

+ Here is the caller graph for this function:

◆ lngData()

LanguageInstallationManagerMigratedModulesTestCase::lngData ( )
protected
Returns
array<string, array{value: string, local_change: ?string}> "module|identifier" => row (last write wins, like ON DUPLICATE KEY UPDATE)

@lang text

@lang text

Definition at line 290 of file LanguageInstallationManagerMigratedModulesTestCase.php.

290 : array
291 {
292 $rows = [];
293 foreach ($this->queries as $query) {
294 if (str_starts_with($query, 'INSERT INTO lng_data')) {
295 preg_match_all('/\‍((Q\d+Q),(Q\d+Q),(Q\d+Q),(Q\d+Q),(Q\d+Q),(Q\d+Q)\‍)/', $query, $matches, PREG_SET_ORDER);
296 foreach ($matches as $match) {
297 $key = $this->resolveToken($match[1]) . '|' . $this->resolveToken($match[2]);
298 $rows[$key] = ['value' => $this->resolveToken($match[4]), 'local_change' => $this->resolveToken($match[5])];
299 }
300 } elseif (str_starts_with($query, 'DELETE FROM lng_data')) {
301 $rows = $this->applyLngDataDelete($query, $rows);
302 }
303 }
304
305 return $rows;
306 }
applyLngDataDelete(string $query, array $rows)
Applies one recorded "DELETE FROM lng_data" to $rows, in the two shapes LanguageInstallationManager i...

References ILIAS\Scripts\PHPStan\$rows.

Referenced by LanguageInstallationManagerMigratedDroppedKeysTest\testACustomizingValueForAKeyDroppedFromTheShippedPoStaysLocal(), LanguageInstallationManagerMigratedAfterWriteTest\testADuplicateInOneFileKeepsTheFirstOccurrenceAndIsReported(), LanguageInstallationManagerMigratedDroppedKeysTest\testAKeyThatReturnsAfterBeingUnshippedKeepsTheLocalChangeOfTheOverlay(), LanguageInstallationManagerMigratedTakeOverTest\testAModuleWithAnUnreadableOverlayIsLeftOutAndTheOthersAreInstalledNormally(), LanguageInstallationManagerMigratedLocalChangesActionsTest\testApplyingLocalChangesPutsTheCustomizingValueOnTopOfTheStoredEntries(), LanguageInstallationManagerMigratedLocalChangesActionsTest\testApplyingLocalChangesReconcilesEveryCaseInOneSweepAndPurgesTheStaleUnchangedRow(), LanguageInstallationManagerMigratedDroppedKeysTest\testAWholeMissingShippedPoIsBridgedByThePreservedOverlayAcrossTwoUpdates(), LanguageInstallationManagerMigratedPluralFormsTest\testInstallAfterTheNumberOfPluralFormsGrewRewritesTheOverlayWithTheNewRuleAndKeepsLocalValues(), LanguageInstallationManagerMigratedPluralFormsTest\testInstallAfterTheNumberOfPluralFormsShrankKeepsTheLocalDefaultFormAndLogsTheLostValue(), LanguageInstallationManagerMigratedSourcesAndLocksTest\testLangLinesOfAMigratedModuleInNonLocalFilesAreIgnored(), LanguageInstallationManagerMigratedLocalChangesActionsTest\testRemovingLocalChangesRebuildsTheOverlayFromTheShippedPo(), and LanguageInstallationManagerMigratedSourcesAndLocksTest\testValuesOfAMigratedModuleComeFromThePoEvenWithoutAnyLangLine().

+ Here is the caller graph for this function:

◆ lngModules()

LanguageInstallationManagerMigratedModulesTestCase::lngModules ( )
protected
Returns
array<string, array<string, string>> module => identifier => value

@lang text

Definition at line 395 of file LanguageInstallationManagerMigratedModulesTestCase.php.

395 : array
396 {
397 $modules = [];
398 foreach ($this->queries as $query) {
399 if (!str_starts_with($query, 'INSERT INTO lng_modules')) {
400 continue;
401 }
402 preg_match_all('/\‍((Q\d+Q),(Q\d+Q),(Q\d+Q)\‍)/', $query, $matches, PREG_SET_ORDER);
403 foreach ($matches as $match) {
404 $modules[$this->resolveToken($match[1])] = unserialize($this->resolveToken($match[3]));
405 }
406 }
407
408 return $modules;
409 }

Referenced by db(), LanguageInstallationManagerDuplicateIdentifiersTest\testACustomizingEntryWhoseIdentifierExistsInAnotherModuleIsSkippedButTheRestIsInstalled(), LanguageInstallationManagerMigratedDroppedKeysTest\testACustomizingValueForAKeyDroppedFromTheShippedPoStaysLocal(), LanguageInstallationManagerMigratedAfterWriteTest\testADuplicateInOneFileKeepsTheFirstOccurrenceAndIsReported(), LanguageInstallationManagerMigratedAfterWriteTest\testAFailingCacheInvalidatorIsLoggedAndSwallowed(), LanguageInstallationManagerMigratedTakeOverTest\testAfterTheRepairTheNextRunInstallsTheModuleAndEmptiesTheSkipList(), LanguageInstallationManagerMigratedDroppedKeysTest\testAKeyDroppedFromTheShippedPoButWithARealLocalChangeIsKept(), LanguageInstallationManagerMigratedDroppedKeysTest\testAKeyDroppedFromTheShippedPoWithACorruptOverlayLeavesItsModuleUnchanged(), LanguageInstallationManagerMigratedDroppedKeysTest\testAKeyDroppedFromTheShippedPoWithoutALocalChangeInTheOverlayIsRemoved(), LanguageInstallationManagerMigratedDroppedKeysTest\testAKeyThatReturnsAfterBeingUnshippedKeepsTheLocalChangeOfTheOverlay(), LanguageInstallationManagerMigratedSourcesAndLocksTest\testAModuleIsOnlyMigratedForLanguagesWithAShippedPo(), LanguageInstallationManagerMigratedTakeOverTest\testAModuleOfNoMigrationIsStillReadFromLngDataAndNotRecorded(), LanguageInstallationManagerMigratedTakeOverTest\testAModuleWithAnUnreadableOverlayIsLeftOutAndTheOthersAreInstalledNormally(), LanguageInstallationManagerDuplicateIdentifiersTest\testAnOldCollisionOfTheOwnModuleIsApplied(), LanguageInstallationManagerMigratedAfterWriteTest\testAnOverlaySyncFailureIsLoggedAndTheDatabaseWriteStays(), LanguageInstallationManagerMigratedLocalChangesActionsTest\testApplyingLocalChangesPutsTheCustomizingValueOnTopOfTheStoredEntries(), LanguageInstallationManagerMigratedLocalChangesActionsTest\testApplyingLocalChangesReconcilesEveryCaseInOneSweepAndPurgesTheStaleUnchangedRow(), LanguageInstallationManagerMigratedAfterWriteTest\testAThrowingLoggerFallsBackToThePhpErrorLogAndDoesNotAbortTheInstallation(), LanguageInstallationManagerMigratedDroppedKeysTest\testAWholeMissingShippedPoIsBridgedByThePreservedOverlayAcrossTwoUpdates(), LanguageInstallationManagerDuplicateIdentifiersTest\testEntriesOfTheSameRunCountAsExisting(), LanguageInstallationManagerMigratedPluralFormsTest\testInstallAfterTheNumberOfPluralFormsGrewRewritesTheOverlayWithTheNewRuleAndKeepsLocalValues(), LanguageInstallationManagerMigratedPluralFormsTest\testInstallAfterTheNumberOfPluralFormsShrankKeepsTheLocalDefaultFormAndLogsTheLostValue(), LanguageInstallationManagerMigratedSourcesAndLocksTest\testLangLinesOfAMigratedModuleInNonLocalFilesAreIgnored(), LanguageInstallationManagerMigratedLocalChangesActionsTest\testRemovingLocalChangesRebuildsTheOverlayFromTheShippedPo(), LanguageInstallationManagerMigratedAfterWriteTest\testTheSameEntryInTwoDifferentFilesIsNotADuplicate(), LanguageInstallationManagerDuplicateIdentifiersTest\testTheSkippedDuplicatesAreResetOnEveryInsertLanguageCall(), LanguageInstallationManagerMigratedSourcesAndLocksTest\testValuesOfAMigratedModuleComeFromThePoEvenWithoutAnyLangLine(), LanguageInstallationManagerMigratedTakeOverTest\testWithoutAClientDataDirectoryLngDataIsUsedAsBeforeAndNothingIsRecorded(), and LanguageInstallationManagerMigratedAfterWriteTest\testWithoutClientDataDirTheDatabaseIsWrittenButNoOverlay().

+ Here is the caller graph for this function:

◆ loggedWarnings()

◆ manager()

LanguageInstallationManagerMigratedModulesTestCase::manager ( ?\Closure  $client_data_dir_resolver = null,
?\Closure  $language_cache_invalidator = null,
bool  $with_resolver = true,
bool  $with_logger = true,
?LoggerInterface  $logger = null 
)
protected

Definition at line 155 of file LanguageInstallationManagerMigratedModulesTestCase.php.

162 $client_data_dir = $this->root . '/client-data';
164 $this->db(),
168 $this->directory,
169 ...$this->further_directories
170 ),
171 $this->root,
172 $this->repository(),
173 static fn(): \DateTimeImmutable => new \DateTimeImmutable(self::NOW, new \DateTimeZone('UTC')),
174 $language_cache_invalidator === null
176 : new CallbackTranslationCache($language_cache_invalidator),
177 $with_resolver ? ($client_data_dir_resolver ?? static fn(): string => $client_data_dir) : null,
178 $logger ?? ($with_logger ? $this->recordingLogger() : null)
179 );
180 }
Lets a test observe or influence the invalidation.
Write access to the language installation: installing, flushing and registering languages in the data...
The Setup has no global cache, hence there is nothing to invalidate.

Referenced by LanguageInstallationManagerDuplicateIdentifiersTest\testACustomizingEntryWhoseIdentifierExistsInAnotherModuleIsSkippedButTheRestIsInstalled(), LanguageInstallationManagerMigratedDroppedKeysTest\testACustomizingValueForAKeyDroppedFromTheShippedPoStaysLocal(), LanguageInstallationManagerMigratedAfterWriteTest\testADuplicateInOneFileKeepsTheFirstOccurrenceAndIsReported(), LanguageInstallationManagerMigratedAfterWriteTest\testAFailingCacheInvalidatorIsLoggedAndSwallowed(), LanguageInstallationManagerMigratedTakeOverTest\testAfterTheRepairTheNextRunInstallsTheModuleAndEmptiesTheSkipList(), LanguageInstallationManagerMigratedDroppedKeysTest\testAKeyDroppedFromTheShippedPoButWithARealLocalChangeIsKept(), LanguageInstallationManagerMigratedDroppedKeysTest\testAKeyDroppedFromTheShippedPoWithACorruptOverlayLeavesItsModuleUnchanged(), LanguageInstallationManagerMigratedDroppedKeysTest\testAKeyDroppedFromTheShippedPoWithoutALocalChangeInTheOverlayIsRemoved(), LanguageInstallationManagerMigratedDroppedKeysTest\testAKeyThatReturnsAfterBeingUnshippedKeepsTheLocalChangeOfTheOverlay(), LanguageInstallationManagerMigratedTakeOverTest\testALocalChangeOfTheOverlayOverrulesTheCustomizingFileUnlessItIsOlder(), LanguageInstallationManagerMigratedUnshippedOverlaysTest\testAMigratedModuleWithoutAShippedPoForTheLanguageIsReportedForThatLanguage(), LanguageInstallationManagerMigratedAfterWriteTest\testAModuleArrayThatCannotBeReadBackThrowsLanguageDataNotSaved(), LanguageInstallationManagerMigratedSourcesAndLocksTest\testAModuleIsOnlyMigratedForLanguagesWithAShippedPo(), LanguageInstallationManagerMigratedTakeOverTest\testAModuleOfNoMigrationIsStillReadFromLngDataAndNotRecorded(), LanguageInstallationManagerMigratedTakeOverTest\testAModuleRecordedWithoutAnOverlayNeverReadsLngDataAgain(), LanguageInstallationManagerMigratedTakeOverTest\testAModuleWhoseOverlayCouldNotBeWrittenIsNotRecorded(), LanguageInstallationManagerMigratedUnshippedOverlaysTest\testAModuleWhoseTakeOverCouldNotBeRecordedIsReportedUntilItIsRecorded(), LanguageInstallationManagerDuplicateIdentifiersTest\testAModuleWithADuplicateCustomizingEntryIsNotRecordedUntilItIsFixed(), LanguageInstallationManagerMigratedTakeOverTest\testAModuleWithAMarkupRejectedCustomizingEntryIsNotRecordedUntilItIsFixed(), LanguageInstallationManagerMigratedSourcesAndLocksTest\testAModuleWithAnExistingOverlayIsLockedForTheWholeRunNotJustItsOwnSync(), LanguageInstallationManagerMigratedTakeOverTest\testAModuleWithAnUnreadableOverlayIsLeftOutAndTheOthersAreInstalledNormally(), LanguageInstallationManagerMigratedSourcesAndLocksTest\testAModuleWithoutAnOverlayThatGetsOneCreatedDuringTheRunIsReportedAndTheOverlaySurvives(), LanguageInstallationManagerMigratedUnshippedOverlaysTest\testAnEntryInTheRecordOfAModuleThatIsNotShippedIsReportedAndKept(), LanguageInstallationManagerDuplicateIdentifiersTest\testAnOldCollisionOfTheOwnModuleIsApplied(), LanguageInstallationManagerMigratedUnshippedOverlaysTest\testAnOverlayOfAModuleThatIsNotShippedIsReportedAndKept(), LanguageInstallationManagerMigratedAfterWriteTest\testAnOverlaySyncFailureIsLoggedAndTheDatabaseWriteStays(), LanguageInstallationManagerMigratedTakeOverTest\testAnUnusableRecordCountsAsEmptyAndTheRowsAreTakenOverAgain(), LanguageInstallationManagerMigratedLocalChangesActionsTest\testApplyingLocalChangesPutsTheCustomizingValueOnTopOfTheStoredEntries(), LanguageInstallationManagerMigratedLocalChangesActionsTest\testApplyingLocalChangesReconcilesEveryCaseInOneSweepAndPurgesTheStaleUnchangedRow(), LanguageInstallationManagerMigratedLocalChangesActionsTest\testApplyingLocalChangesWritesTheRowsBeforeItPurgesTheStaleOnes(), LanguageInstallationManagerMigratedTakeOverTest\testAReadableOverlayWithoutTheRecordWinsOverLngData(), LanguageInstallationManagerMigratedAfterWriteTest\testASerializedFalseIsAlsoDetectedAsNotSaved(), LanguageInstallationManagerMigratedAfterWriteTest\testAThrowingLoggerFallsBackToThePhpErrorLogAndDoesNotAbortTheInstallation(), LanguageInstallationManagerMigratedDroppedKeysTest\testAWholeMissingShippedPoIsBridgedByThePreservedOverlayAcrossTwoUpdates(), LanguageInstallationManagerDuplicateIdentifiersTest\testEntriesOfTheSameRunCountAsExisting(), LanguageInstallationManagerMigratedAfterWriteTest\testEveryWritePathReturnsNothingWhenTheOverlayWasWritten(), LanguageInstallationManagerMigratedAfterWriteTest\testEveryWritePathReturnsOnlyTheModulesWhoseOverlayCouldNotBeWritten(), LanguageInstallationManagerMigratedAfterWriteTest\testFindUnwritableOverlayDirectoriesChecksTheResolvedClientDataDir(), LanguageInstallationManagerMigratedPluralFormsTest\testInstallAfterASingleFormLanguageGotASecondFormGivesTheLocalValueToBothForms(), LanguageInstallationManagerMigratedPluralFormsTest\testInstallAfterTheNumberOfPluralFormsGrewRewritesTheOverlayWithTheNewRuleAndKeepsLocalValues(), LanguageInstallationManagerMigratedPluralFormsTest\testInstallAfterTheNumberOfPluralFormsShrankKeepsTheLocalDefaultFormAndLogsTheLostValue(), LanguageInstallationManagerMigratedSourcesAndLocksTest\testInstallWithoutLocalChangesWritesNoOverlayOnlyTheTakenOverRecord(), LanguageInstallationManagerMigratedSourcesAndLocksTest\testLangLinesOfAMigratedModuleInNonLocalFilesAreIgnored(), LanguageInstallationManagerMigratedUnshippedOverlaysTest\testNothingIsReportedForARegularRun(), LanguageInstallationManagerMigratedUnshippedOverlaysTest\testOnlyModulesWithLocalChangesNotYetInTheRecordAreReportedAsUnrecorded(), LanguageInstallationManagerMigratedLocalChangesActionsTest\testRemovingLocalChangesRebuildsTheOverlayFromTheShippedPo(), LanguageInstallationManagerMigratedUnshippedOverlaysTest\testShippedModulesAreNotReportedAndAModuleInRecordAndOverlayIsReportedOnce(), LanguageInstallationManagerMigratedAfterWriteTest\testTheLanguageCacheIsInvalidatedWithTheLanguageKeyBeforeTheOverlayIsSynced(), LanguageInstallationManagerMigratedTakeOverTest\testTheLngDataLocalChangesAreTakenOverOnceAndNeverReadAgain(), LanguageInstallationManagerMigratedUnshippedOverlaysTest\testTheReportIsPerLanguageAndRebuiltByEveryCall(), LanguageInstallationManagerMigratedUnshippedOverlaysTest\testTheReportSurvivesTheInstallationFollowedByApplyingLocalChanges(), LanguageInstallationManagerMigratedAfterWriteTest\testTheResolversClientDataDirIsUsedAndResolvedAtCallTime(), LanguageInstallationManagerMigratedAfterWriteTest\testTheSameEntryInTwoDifferentFilesIsNotADuplicate(), LanguageInstallationManagerDuplicateIdentifiersTest\testTheSkippedDuplicatesAreResetOnEveryInsertLanguageCall(), LanguageInstallationManagerMigratedTakeOverTest\testUninstallingTheLanguageForgetsTheRecordAndAReinstallTakesTheRowsOverAgain(), LanguageInstallationManagerMigratedSourcesAndLocksTest\testValuesOfAMigratedModuleComeFromThePoEvenWithoutAnyLangLine(), LanguageInstallationManagerMigratedTakeOverTest\testWithoutAClientDataDirectoryLngDataIsUsedAsBeforeAndNothingIsRecorded(), LanguageInstallationManagerMigratedUnshippedOverlaysTest\testWithoutAClientDataDirectoryNothingIsReported(), LanguageInstallationManagerMigratedAfterWriteTest\testWithoutALoggerAWarningGoesToThePhpErrorLog(), LanguageInstallationManagerMigratedAfterWriteTest\testWithoutClientDataDirNothingIsReturnedAsUnwritten(), and LanguageInstallationManagerMigratedAfterWriteTest\testWithoutClientDataDirTheDatabaseIsWrittenButNoOverlay().

+ Here is the caller graph for this function:

◆ overlayBase()

LanguageInstallationManagerMigratedModulesTestCase::overlayBase ( )
protected

Definition at line 242 of file LanguageInstallationManagerMigratedModulesTestCase.php.

242 : string
243 {
244 return $this->root . '/client-data/lang/pilot/de/pilot_de';
245 }

Referenced by LanguageInstallationManagerMigratedTakeOverTest\corruptOverlay(), LanguageInstallationManagerMigratedAfterWriteTest\testAFailingCacheInvalidatorIsLoggedAndSwallowed(), LanguageInstallationManagerMigratedDroppedKeysTest\testAKeyDroppedFromTheShippedPoWithACorruptOverlayLeavesItsModuleUnchanged(), LanguageInstallationManagerMigratedDroppedKeysTest\testAKeyDroppedFromTheShippedPoWithoutALocalChangeInTheOverlayIsRemoved(), LanguageInstallationManagerMigratedAfterWriteTest\testAModuleArrayThatCannotBeReadBackThrowsLanguageDataNotSaved(), LanguageInstallationManagerMigratedTakeOverTest\testAModuleRecordedWithoutAnOverlayNeverReadsLngDataAgain(), LanguageInstallationManagerMigratedSourcesAndLocksTest\testAModuleWithAnExistingOverlayIsLockedForTheWholeRunNotJustItsOwnSync(), LanguageInstallationManagerMigratedTakeOverTest\testAModuleWithAnUnreadableOverlayIsLeftOutAndTheOthersAreInstalledNormally(), LanguageInstallationManagerMigratedSourcesAndLocksTest\testAModuleWithoutAnOverlayThatGetsOneCreatedDuringTheRunIsReportedAndTheOverlaySurvives(), LanguageInstallationManagerMigratedPluralFormsTest\testAnExistingOverlayIsServedWithItsOwnRuleUntilTheNextReconcilingWrite(), LanguageInstallationManagerMigratedDroppedKeysTest\testAWholeMissingShippedPoIsBridgedByThePreservedOverlayAcrossTwoUpdates(), LanguageInstallationManagerMigratedAfterWriteTest\testEveryWritePathReturnsNothingWhenTheOverlayWasWritten(), LanguageInstallationManagerMigratedPluralFormsTest\testInstallAfterTheNumberOfPluralFormsGrewRewritesTheOverlayWithTheNewRuleAndKeepsLocalValues(), LanguageInstallationManagerMigratedPluralFormsTest\testInstallAfterTheNumberOfPluralFormsShrankKeepsTheLocalDefaultFormAndLogsTheLostValue(), LanguageInstallationManagerMigratedLocalChangesActionsTest\testRemovingLocalChangesRebuildsTheOverlayFromTheShippedPo(), LanguageInstallationManagerMigratedAfterWriteTest\testTheLanguageCacheIsInvalidatedWithTheLanguageKeyBeforeTheOverlayIsSynced(), and LanguageInstallationManagerMigratedTakeOverTest\testUninstallingTheLanguageForgetsTheRecordAndAReinstallTakesTheRowsOverAgain().

+ Here is the caller graph for this function:

◆ overlayPo()

LanguageInstallationManagerMigratedModulesTestCase::overlayPo ( )
protected

Definition at line 247 of file LanguageInstallationManagerMigratedModulesTestCase.php.

248 {
249 return MigratedPoFixture::readPo($this->overlayBase() . '.po');
250 }
An in-memory gettext catalog (header block plus messages) and the only place of the component that re...
static readPo(string $file)

References MigratedPoFixture\readPo().

Referenced by LanguageInstallationManagerMigratedDroppedKeysTest\testAKeyDroppedFromTheShippedPoButWithARealLocalChangeIsKept(), LanguageInstallationManagerMigratedSourcesAndLocksTest\testAModuleWithoutAnOverlayThatGetsOneCreatedDuringTheRunIsReportedAndTheOverlaySurvives(), LanguageInstallationManagerMigratedLocalChangesActionsTest\testApplyingLocalChangesPutsTheCustomizingValueOnTopOfTheStoredEntries(), LanguageInstallationManagerMigratedDroppedKeysTest\testAWholeMissingShippedPoIsBridgedByThePreservedOverlayAcrossTwoUpdates(), LanguageInstallationManagerMigratedPluralFormsTest\testInstallAfterASingleFormLanguageGotASecondFormGivesTheLocalValueToBothForms(), LanguageInstallationManagerMigratedPluralFormsTest\testInstallAfterTheNumberOfPluralFormsGrewRewritesTheOverlayWithTheNewRuleAndKeepsLocalValues(), LanguageInstallationManagerMigratedPluralFormsTest\testInstallAfterTheNumberOfPluralFormsShrankKeepsTheLocalDefaultFormAndLogsTheLostValue(), and LanguageInstallationManagerMigratedTakeOverTest\testTheLngDataLocalChangesAreTakenOverOnceAndNeverReadAgain().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ recordingLogger()

LanguageInstallationManagerMigratedModulesTestCase::recordingLogger ( )
private

Definition at line 182 of file LanguageInstallationManagerMigratedModulesTestCase.php.

183 {
184 $logger = $this->createStub(LoggerInterface::class);
185 $logger->method('warning')->willReturnCallback(
186 function (string|\Stringable $message): void {
187 $this->logged_warnings[] = (string) $message;
188 }
189 );
190
191 return $logger;
192 }

References ILIAS\TestQuestionPool\ExportImport\Foundation\Export\$logger, and $message.

◆ repository()

LanguageInstallationManagerMigratedModulesTestCase::repository ( )
protected

Definition at line 143 of file LanguageInstallationManagerMigratedModulesTestCase.php.

144 {
145 $repository = $this->createStub(InstalledLanguageRepository::class);
146 $repository->method('getLocalChanges')->willReturnCallback(
147 fn(string $lang_key, string $min_date = ''): array => $min_date === '' ? $this->db_local_changes : []
148 );
149 $repository->method('getLanguageEntries')->willReturnCallback(fn(): array => $this->db_entries);
150 $repository->method('getAvailableLanguages')->willReturnCallback(fn(): array => $this->available_languages);
151
152 return $repository;
153 }
Read-only access to the installed languages (database) and the available or valid language files (fil...

Referenced by LanguageInstallationManagerMigratedSourcesAndLocksTest\testLocksAreAcquiredInSortedOrderRegardlessOfTheContributedDirectoryOrder().

+ Here is the caller graph for this function:

◆ resolveToken()

LanguageInstallationManagerMigratedModulesTestCase::resolveToken ( string  $token)
protected

Definition at line 281 of file LanguageInstallationManagerMigratedModulesTestCase.php.

281 : mixed
282 {
283 return $this->quoted[(int) trim($token, 'Q')];
284 }
$token
Definition: xapitoken.php:69

References $token, and ILIAS\Repository\int().

+ Here is the call graph for this function:

◆ seedOverlay()

LanguageInstallationManagerMigratedModulesTestCase::seedOverlay ( array  $entries)
protected
Parameters
array<string,string|array<string,mixed>>$entries

Definition at line 237 of file LanguageInstallationManagerMigratedModulesTestCase.php.

237 : void
238 {
240 }
static writePair(string $base_path, TranslationCatalog $catalog)
Writes "<base>.po" and, like MigratedLanguageFileSync::sync(), its compiled revision named by current...
static catalog(string $module, array $entries)

References MigratedPoFixture\catalog(), and MigratedPoFixture\writePair().

Referenced by LanguageInstallationManagerMigratedDroppedKeysTest\testACustomizingValueForAKeyDroppedFromTheShippedPoStaysLocal(), LanguageInstallationManagerMigratedAfterWriteTest\testAFailingCacheInvalidatorIsLoggedAndSwallowed(), LanguageInstallationManagerMigratedTakeOverTest\testAfterTheRepairTheNextRunInstallsTheModuleAndEmptiesTheSkipList(), LanguageInstallationManagerMigratedDroppedKeysTest\testAKeyDroppedFromTheShippedPoButWithARealLocalChangeIsKept(), LanguageInstallationManagerMigratedDroppedKeysTest\testAKeyDroppedFromTheShippedPoWithACorruptOverlayLeavesItsModuleUnchanged(), LanguageInstallationManagerMigratedDroppedKeysTest\testAKeyDroppedFromTheShippedPoWithoutALocalChangeInTheOverlayIsRemoved(), LanguageInstallationManagerMigratedDroppedKeysTest\testAKeyThatReturnsAfterBeingUnshippedKeepsTheLocalChangeOfTheOverlay(), LanguageInstallationManagerMigratedReconciliationTest\testALocalChangeIsReconciledWithTheShippedValue(), LanguageInstallationManagerMigratedTakeOverTest\testALocalChangeOfTheOverlayOverrulesTheCustomizingFileUnlessItIsOlder(), LanguageInstallationManagerMigratedSourcesAndLocksTest\testAModuleWithAnExistingOverlayIsLockedForTheWholeRunNotJustItsOwnSync(), LanguageInstallationManagerMigratedTakeOverTest\testAModuleWithAnUnreadableOverlayIsLeftOutAndTheOthersAreInstalledNormally(), LanguageInstallationManagerMigratedLocalChangesActionsTest\testApplyingLocalChangesPutsTheCustomizingValueOnTopOfTheStoredEntries(), LanguageInstallationManagerMigratedLocalChangesActionsTest\testApplyingLocalChangesReconcilesEveryCaseInOneSweepAndPurgesTheStaleUnchangedRow(), LanguageInstallationManagerMigratedTakeOverTest\testAReadableOverlayWithoutTheRecordWinsOverLngData(), LanguageInstallationManagerMigratedDroppedKeysTest\testAWholeMissingShippedPoIsBridgedByThePreservedOverlayAcrossTwoUpdates(), LanguageInstallationManagerMigratedLocalChangesActionsTest\testRemovingLocalChangesRebuildsTheOverlayFromTheShippedPo(), and LanguageInstallationManagerMigratedUnshippedOverlaysTest\testShippedModulesAreNotReportedAndAModuleInRecordAndOverlayIsReportedOnce().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ seedOverlayMarkedAsMerged()

LanguageInstallationManagerMigratedModulesTestCase::seedOverlayMarkedAsMerged ( array  $entries,
array  $merged 
)
protected
Parameters
array<string,string>$entries identifier => local value (original "Hallo")
list<string>$merged identifiers marked as merged into the shipped file

Definition at line 463 of file LanguageInstallationManagerMigratedModulesTestCase.php.

463 : void
464 {
465 $details = [];
466 foreach ($entries as $identifier => $value) {
467 $details[$identifier] = ['value' => $value, 'original' => 'Hallo', 'local_change' => '2025-04-04T04:04:04Z'];
468 }
469 $catalog = MigratedPoFixture::catalog(self::MODULE, $details);
470 foreach ($merged as $identifier) {
471 LocalChangeComments::setMergedIntoShipped($catalog->find(self::MODULE, $identifier), true);
472 }
473 MigratedPoFixture::writePair($this->overlayBase(), $catalog);
474 }

References MigratedPoFixture\catalog(), and MigratedPoFixture\writePair().

+ Here is the call graph for this function:

◆ setUp()

LanguageInstallationManagerMigratedModulesTestCase::setUp ( )
protected

Definition at line 77 of file LanguageInstallationManagerMigratedModulesTestCase.php.

77 : void
78 {
79 // never the build of the installation, see MigratedPoFixture::resetRuntime()
81 $this->root = sys_get_temp_dir() . '/ilias_lim_test_' . bin2hex(random_bytes(6));
82 mkdir($this->root . '/lang/customizing', 0775, true);
83 mkdir($this->root . '/client-data', 0775, true);
84 $this->directory = MigratedPoFixture::directory(self::MODULE, 'components/pilot/lang/');
85 }
static directory(string $prefix, string $path, bool $local=false)
static resetRuntime(?string $artifact_directory=null)
Forgets the static state of the runtime read path and points build and runtime at $artifact_directory...

References MigratedPoFixture\directory(), and MigratedPoFixture\resetRuntime().

+ Here is the call graph for this function:

◆ shipPluralPo()

LanguageInstallationManagerMigratedModulesTestCase::shipPluralPo ( array  $entries,
string  $header 
)
protected
Parameters
array<string,list<string>|string>$entries

Definition at line 427 of file LanguageInstallationManagerMigratedModulesTestCase.php.

427 : void
428 {
429 $catalog = new TranslationCatalog();
430 $catalog->setHeader('Content-Type', 'text/plain; charset=UTF-8');
431 $catalog->setHeader('Plural-Forms', $header);
432 foreach ($entries as $identifier => $value) {
433 $entry = new \ILIAS\Language\ComponentTranslation\Catalog\TranslationEntry(self::MODULE, (string) $identifier);
434 if (is_array($value)) {
435 $entry->setPlural($identifier . '_plural', $value);
436 } else {
437 $entry->translate($value);
438 }
439 $catalog->add($entry);
440 }
441 MigratedPoFixture::writePo($this->root . '/components/pilot/lang/pilot_de.po', $catalog);
442 }
static writePo(string $file, TranslationCatalog $catalog)

References MigratedPoFixture\writePo().

Referenced by LanguageInstallationManagerMigratedPluralFormsTest\testAnExistingOverlayIsServedWithItsOwnRuleUntilTheNextReconcilingWrite(), LanguageInstallationManagerMigratedPluralFormsTest\testInstallAfterASingleFormLanguageGotASecondFormGivesTheLocalValueToBothForms(), LanguageInstallationManagerMigratedPluralFormsTest\testInstallAfterTheNumberOfPluralFormsGrewRewritesTheOverlayWithTheNewRuleAndKeepsLocalValues(), and LanguageInstallationManagerMigratedPluralFormsTest\testInstallAfterTheNumberOfPluralFormsShrankKeepsTheLocalDefaultFormAndLogsTheLostValue().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ shipPo()

LanguageInstallationManagerMigratedModulesTestCase::shipPo ( array  $entries,
string  $lang_key = 'de' 
)
protected
Parameters
array<string,string|array<string,mixed>>$entries

Definition at line 215 of file LanguageInstallationManagerMigratedModulesTestCase.php.

215 : void
216 {
218 $this->root . '/components/pilot/lang/pilot_' . $lang_key . '.po',
219 MigratedPoFixture::catalog(self::MODULE, $entries)
220 );
221 }

References MigratedPoFixture\catalog(), and MigratedPoFixture\writePo().

Referenced by LanguageInstallationManagerMigratedDroppedKeysTest\testACustomizingValueForAKeyDroppedFromTheShippedPoStaysLocal(), LanguageInstallationManagerMigratedAfterWriteTest\testAFailingCacheInvalidatorIsLoggedAndSwallowed(), LanguageInstallationManagerMigratedTakeOverTest\testAfterTheRepairTheNextRunInstallsTheModuleAndEmptiesTheSkipList(), LanguageInstallationManagerMigratedDroppedKeysTest\testAKeyDroppedFromTheShippedPoButWithARealLocalChangeIsKept(), LanguageInstallationManagerMigratedDroppedKeysTest\testAKeyDroppedFromTheShippedPoWithACorruptOverlayLeavesItsModuleUnchanged(), LanguageInstallationManagerMigratedDroppedKeysTest\testAKeyDroppedFromTheShippedPoWithoutALocalChangeInTheOverlayIsRemoved(), LanguageInstallationManagerMigratedDroppedKeysTest\testAKeyThatReturnsAfterBeingUnshippedKeepsTheLocalChangeOfTheOverlay(), LanguageInstallationManagerMigratedTakeOverTest\testALocalChangeOfTheOverlayOverrulesTheCustomizingFileUnlessItIsOlder(), LanguageInstallationManagerMigratedUnshippedOverlaysTest\testAMigratedModuleWithoutAShippedPoForTheLanguageIsReportedForThatLanguage(), LanguageInstallationManagerMigratedAfterWriteTest\testAModuleArrayThatCannotBeReadBackThrowsLanguageDataNotSaved(), LanguageInstallationManagerMigratedSourcesAndLocksTest\testAModuleIsOnlyMigratedForLanguagesWithAShippedPo(), LanguageInstallationManagerMigratedTakeOverTest\testAModuleOfNoMigrationIsStillReadFromLngDataAndNotRecorded(), LanguageInstallationManagerMigratedTakeOverTest\testAModuleRecordedWithoutAnOverlayNeverReadsLngDataAgain(), LanguageInstallationManagerMigratedTakeOverTest\testAModuleWhoseOverlayCouldNotBeWrittenIsNotRecorded(), LanguageInstallationManagerMigratedUnshippedOverlaysTest\testAModuleWhoseTakeOverCouldNotBeRecordedIsReportedUntilItIsRecorded(), LanguageInstallationManagerDuplicateIdentifiersTest\testAModuleWithADuplicateCustomizingEntryIsNotRecordedUntilItIsFixed(), LanguageInstallationManagerMigratedTakeOverTest\testAModuleWithAMarkupRejectedCustomizingEntryIsNotRecordedUntilItIsFixed(), LanguageInstallationManagerMigratedSourcesAndLocksTest\testAModuleWithAnExistingOverlayIsLockedForTheWholeRunNotJustItsOwnSync(), LanguageInstallationManagerMigratedTakeOverTest\testAModuleWithAnUnreadableOverlayIsLeftOutAndTheOthersAreInstalledNormally(), LanguageInstallationManagerMigratedSourcesAndLocksTest\testAModuleWithoutAnOverlayThatGetsOneCreatedDuringTheRunIsReportedAndTheOverlaySurvives(), LanguageInstallationManagerMigratedUnshippedOverlaysTest\testAnEntryInTheRecordOfAModuleThatIsNotShippedIsReportedAndKept(), LanguageInstallationManagerMigratedUnshippedOverlaysTest\testAnOverlayOfAModuleThatIsNotShippedIsReportedAndKept(), LanguageInstallationManagerMigratedAfterWriteTest\testAnOverlaySyncFailureIsLoggedAndTheDatabaseWriteStays(), LanguageInstallationManagerMigratedTakeOverTest\testAnUnusableRecordCountsAsEmptyAndTheRowsAreTakenOverAgain(), LanguageInstallationManagerMigratedLocalChangesActionsTest\testApplyingLocalChangesPutsTheCustomizingValueOnTopOfTheStoredEntries(), LanguageInstallationManagerMigratedLocalChangesActionsTest\testApplyingLocalChangesReconcilesEveryCaseInOneSweepAndPurgesTheStaleUnchangedRow(), LanguageInstallationManagerMigratedLocalChangesActionsTest\testApplyingLocalChangesWritesTheRowsBeforeItPurgesTheStaleOnes(), LanguageInstallationManagerMigratedTakeOverTest\testAReadableOverlayWithoutTheRecordWinsOverLngData(), LanguageInstallationManagerMigratedAfterWriteTest\testAThrowingLoggerFallsBackToThePhpErrorLogAndDoesNotAbortTheInstallation(), LanguageInstallationManagerMigratedDroppedKeysTest\testAWholeMissingShippedPoIsBridgedByThePreservedOverlayAcrossTwoUpdates(), LanguageInstallationManagerDuplicateIdentifiersTest\testEntriesOfTheSameRunCountAsExisting(), LanguageInstallationManagerMigratedAfterWriteTest\testEveryWritePathReturnsNothingWhenTheOverlayWasWritten(), LanguageInstallationManagerMigratedAfterWriteTest\testEveryWritePathReturnsOnlyTheModulesWhoseOverlayCouldNotBeWritten(), LanguageInstallationManagerMigratedAfterWriteTest\testFindUnwritableOverlayDirectoriesChecksTheResolvedClientDataDir(), LanguageInstallationManagerMigratedSourcesAndLocksTest\testInstallWithoutLocalChangesWritesNoOverlayOnlyTheTakenOverRecord(), LanguageInstallationManagerMigratedSourcesAndLocksTest\testLangLinesOfAMigratedModuleInNonLocalFilesAreIgnored(), LanguageInstallationManagerMigratedUnshippedOverlaysTest\testNothingIsReportedForARegularRun(), LanguageInstallationManagerMigratedUnshippedOverlaysTest\testOnlyModulesWithLocalChangesNotYetInTheRecordAreReportedAsUnrecorded(), LanguageInstallationManagerMigratedLocalChangesActionsTest\testRemovingLocalChangesRebuildsTheOverlayFromTheShippedPo(), LanguageInstallationManagerMigratedUnshippedOverlaysTest\testShippedModulesAreNotReportedAndAModuleInRecordAndOverlayIsReportedOnce(), LanguageInstallationManagerMigratedAfterWriteTest\testTheLanguageCacheIsInvalidatedWithTheLanguageKeyBeforeTheOverlayIsSynced(), LanguageInstallationManagerMigratedTakeOverTest\testTheLngDataLocalChangesAreTakenOverOnceAndNeverReadAgain(), LanguageInstallationManagerMigratedUnshippedOverlaysTest\testTheReportIsPerLanguageAndRebuiltByEveryCall(), LanguageInstallationManagerMigratedUnshippedOverlaysTest\testTheReportSurvivesTheInstallationFollowedByApplyingLocalChanges(), LanguageInstallationManagerMigratedAfterWriteTest\testTheResolversClientDataDirIsUsedAndResolvedAtCallTime(), LanguageInstallationManagerMigratedTakeOverTest\testUninstallingTheLanguageForgetsTheRecordAndAReinstallTakesTheRowsOverAgain(), LanguageInstallationManagerMigratedSourcesAndLocksTest\testValuesOfAMigratedModuleComeFromThePoEvenWithoutAnyLangLine(), LanguageInstallationManagerMigratedTakeOverTest\testWithoutAClientDataDirectoryLngDataIsUsedAsBeforeAndNothingIsRecorded(), LanguageInstallationManagerMigratedUnshippedOverlaysTest\testWithoutAClientDataDirectoryNothingIsReported(), LanguageInstallationManagerMigratedAfterWriteTest\testWithoutALoggerAWarningGoesToThePhpErrorLog(), LanguageInstallationManagerMigratedAfterWriteTest\testWithoutClientDataDirNothingIsReturnedAsUnwritten(), and LanguageInstallationManagerMigratedAfterWriteTest\testWithoutClientDataDirTheDatabaseIsWrittenButNoOverlay().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ shipSecondModule()

list< LanguageFileDirectory > further contributed modules see LanguageInstallationManagerMigratedModulesTestCase::shipSecondModule ( array  $entries)
protected

◆ tearDown()

LanguageInstallationManagerMigratedModulesTestCase::tearDown ( )
protected

Definition at line 87 of file LanguageInstallationManagerMigratedModulesTestCase.php.

87 : void
88 {
91 }
static removeDirectory(string $directory)

References MigratedPoFixture\removeDirectory(), and MigratedPoFixture\resetRuntime().

+ Here is the call graph for this function:

◆ writeLang()

LanguageInstallationManagerMigratedModulesTestCase::writeLang ( string  $relative_file,
array  $lines 
)
protected
Parameters
list<string>$lines raw lines after the header marker

Definition at line 272 of file LanguageInstallationManagerMigratedModulesTestCase.php.

272 : void
273 {
274 $file = $this->root . '/' . $relative_file;
275 if (!is_dir(dirname($file))) {
276 mkdir(dirname($file), 0775, true);
277 }
278 file_put_contents($file, "header\n<!-- language file start -->\n" . implode("\n", $lines) . "\n");
279 }

Referenced by LanguageInstallationManagerDuplicateIdentifiersTest\testACustomizingEntryWhoseIdentifierExistsInAnotherModuleIsSkippedButTheRestIsInstalled(), LanguageInstallationManagerMigratedDroppedKeysTest\testACustomizingValueForAKeyDroppedFromTheShippedPoStaysLocal(), LanguageInstallationManagerMigratedAfterWriteTest\testADuplicateInOneFileKeepsTheFirstOccurrenceAndIsReported(), LanguageInstallationManagerMigratedTakeOverTest\testALocalChangeOfTheOverlayOverrulesTheCustomizingFileUnlessItIsOlder(), LanguageInstallationManagerMigratedSourcesAndLocksTest\testAModuleIsOnlyMigratedForLanguagesWithAShippedPo(), LanguageInstallationManagerMigratedTakeOverTest\testAModuleOfNoMigrationIsStillReadFromLngDataAndNotRecorded(), LanguageInstallationManagerDuplicateIdentifiersTest\testAModuleWithADuplicateCustomizingEntryIsNotRecordedUntilItIsFixed(), LanguageInstallationManagerMigratedTakeOverTest\testAModuleWithAMarkupRejectedCustomizingEntryIsNotRecordedUntilItIsFixed(), LanguageInstallationManagerMigratedTakeOverTest\testAModuleWithAnUnreadableOverlayIsLeftOutAndTheOthersAreInstalledNormally(), LanguageInstallationManagerDuplicateIdentifiersTest\testAnOldCollisionOfTheOwnModuleIsApplied(), LanguageInstallationManagerMigratedLocalChangesActionsTest\testApplyingLocalChangesPutsTheCustomizingValueOnTopOfTheStoredEntries(), LanguageInstallationManagerMigratedAfterWriteTest\testASerializedFalseIsAlsoDetectedAsNotSaved(), LanguageInstallationManagerMigratedDroppedKeysTest\testAWholeMissingShippedPoIsBridgedByThePreservedOverlayAcrossTwoUpdates(), LanguageInstallationManagerDuplicateIdentifiersTest\testEntriesOfTheSameRunCountAsExisting(), LanguageInstallationManagerMigratedAfterWriteTest\testEveryWritePathReturnsNothingWhenTheOverlayWasWritten(), LanguageInstallationManagerMigratedAfterWriteTest\testEveryWritePathReturnsOnlyTheModulesWhoseOverlayCouldNotBeWritten(), LanguageInstallationManagerMigratedSourcesAndLocksTest\testLangLinesOfAMigratedModuleInNonLocalFilesAreIgnored(), LanguageInstallationManagerMigratedLocalChangesActionsTest\testRemovingLocalChangesRebuildsTheOverlayFromTheShippedPo(), LanguageInstallationManagerMigratedAfterWriteTest\testTheSameEntryInTwoDifferentFilesIsNotADuplicate(), LanguageInstallationManagerDuplicateIdentifiersTest\testTheSkippedDuplicatesAreResetOnEveryInsertLanguageCall(), and LanguageInstallationManagerMigratedSourcesAndLocksTest\testValuesOfAMigratedModuleComeFromThePoEvenWithoutAnyLangLine().

+ Here is the caller graph for this function:

◆ writeLocalOverlay()

LanguageInstallationManagerMigratedModulesTestCase::writeLocalOverlay ( array  $flat_values)
protected

Field Documentation

◆ $available_languages

array LanguageInstallationManagerMigratedModulesTestCase::$available_languages = []
protected

◆ $collation_rows

array LanguageInstallationManagerMigratedModulesTestCase::$collation_rows = null
protected

◆ $db_entries

array LanguageInstallationManagerMigratedModulesTestCase::$db_entries = []
protected

◆ $db_local_changes

array LanguageInstallationManagerMigratedModulesTestCase::$db_local_changes = []
protected

◆ $directory

LanguageFileDirectory LanguageInstallationManagerMigratedModulesTestCase::$directory
protected

◆ $duplicate_rows

array LanguageInstallationManagerMigratedModulesTestCase::$duplicate_rows = []
protected

Definition at line 63 of file LanguageInstallationManagerMigratedModulesTestCase.php.

Referenced by db().

◆ $expects_manager_warning

bool LanguageInstallationManagerMigratedModulesTestCase::$expects_manager_warning = false
private

◆ $further_directories

array LanguageInstallationManagerMigratedModulesTestCase::$further_directories = []
protected

◆ $local_change_rows

array LanguageInstallationManagerMigratedModulesTestCase::$local_change_rows = []
protected

Definition at line 65 of file LanguageInstallationManagerMigratedModulesTestCase.php.

Referenced by db().

◆ $logged_warnings

array LanguageInstallationManagerMigratedModulesTestCase::$logged_warnings = []
protected

◆ $pending_rows

array LanguageInstallationManagerMigratedModulesTestCase::$pending_rows = []
protected

◆ $queries

array LanguageInstallationManagerMigratedModulesTestCase::$queries = []
protected

◆ $quoted

array LanguageInstallationManagerMigratedModulesTestCase::$quoted = []
protected

◆ $root

string LanguageInstallationManagerMigratedModulesTestCase::$root
protected

◆ MODULE

const string LanguageInstallationManagerMigratedModulesTestCase::MODULE = 'pilot'
protected

◆ NOW

const string LanguageInstallationManagerMigratedModulesTestCase::NOW = '2026-01-02 03:04:05'
protected

◆ THREE_FORMS

const string LanguageInstallationManagerMigratedModulesTestCase::THREE_FORMS = 'nplurals=3; plural=(n == 1 ? 0 : n >= 2 && n <= 4 ? 1 : 2);'
protected

◆ TWO_FORMS

const string LanguageInstallationManagerMigratedModulesTestCase::TWO_FORMS = 'nplurals=2; plural=(n != 1);'
protected

The documentation for this class was generated from the following file: