ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
LanguageInstallationManagerMigratedAfterWriteTest Class Reference
+ Inheritance diagram for LanguageInstallationManagerMigratedAfterWriteTest:
+ Collaboration diagram for LanguageInstallationManagerMigratedAfterWriteTest:

Public Member Functions

 testAModuleArrayThatCannotBeReadBackThrowsLanguageDataNotSaved ()
 
 testASerializedFalseIsAlsoDetectedAsNotSaved ()
 
 testTheLanguageCacheIsInvalidatedWithTheLanguageKeyBeforeTheOverlayIsSynced ()
 
 testAFailingCacheInvalidatorIsLoggedAndSwallowed ()
 
 testWithoutALoggerAWarningGoesToThePhpErrorLog ()
 
 testAThrowingLoggerFallsBackToThePhpErrorLogAndDoesNotAbortTheInstallation ()
 
 testAnOverlaySyncFailureIsLoggedAndTheDatabaseWriteStays ()
 Root-proof overlay failure (a file where the overlay's "lang" directory must be created): logged, the database write stays. More...
 
 testEveryWritePathReturnsOnlyTheModulesWhoseOverlayCouldNotBeWritten (string $method, bool $writes_overlay)
 The same failure is returned by all three write paths - and only the migrated module whose overlay failed is listed, never a non-migrated one written in the same run. More...
 
 testEveryWritePathReturnsNothingWhenTheOverlayWasWritten (string $method, bool $writes_overlay)
 
 testWithoutClientDataDirNothingIsReturnedAsUnwritten ()
 No overlay is maintained without client data directory - that is not a failure to report. More...
 
 testFindUnwritableOverlayDirectoriesChecksTheResolvedClientDataDir ()
 Checked against the client data directory the instance maintains the overlay in (resolved at call time), for the migrated modules of the given languages only. More...
 
 testTheResolversClientDataDirIsUsedAndResolvedAtCallTime ()
 
 testWithoutClientDataDirTheDatabaseIsWrittenButNoOverlay (bool $with_resolver)
 
 testADuplicateInOneFileKeepsTheFirstOccurrenceAndIsReported ()
 Shipped ilias_fa.lang/ilias_nl.lang contain duplicates: the first occurrence wins, the update does not abort, and the duplicates are reported. More...
 
 testTheSameEntryInTwoDifferentFilesIsNotADuplicate ()
 

Static Public Member Functions

static writePaths ()
 
static noClientDataDir ()
 

Additional Inherited Members

- Protected Member Functions inherited from LanguageInstallationManagerMigratedModulesTestCase
 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 inherited from LanguageInstallationManagerMigratedModulesTestCase
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);'
 

Detailed Description

Member Function Documentation

◆ noClientDataDir()

static LanguageInstallationManagerMigratedAfterWriteTest::noClientDataDir ( )
static
Returns
array<string, array<int, mixed>>

Definition at line 281 of file LanguageInstallationManagerMigratedAfterWriteTest.php.

281 : array
282 {
283 return ['resolver returns null' => [true], 'no resolver' => [false]];
284 }

◆ testADuplicateInOneFileKeepsTheFirstOccurrenceAndIsReported()

LanguageInstallationManagerMigratedAfterWriteTest::testADuplicateInOneFileKeepsTheFirstOccurrenceAndIsReported ( )

Shipped ilias_fa.lang/ilias_nl.lang contain duplicates: the first occurrence wins, the update does not abort, and the duplicates are reported.

Definition at line 290 of file LanguageInstallationManagerMigratedAfterWriteTest.php.

290 : void
291 {
292 $this->expectManagerWarning();
293 $this->writeLang('lang/ilias_de.lang', [
294 'common#:#yes#:#Ja',
295 'common#:#yes#:#Doppelt',
296 'common#:#no#:#Nein',
297 ]);
298
299 $this->manager()->insertLanguageForInstallation('de');
300
301 $this->assertSame(['yes' => 'Ja', 'no' => 'Nein'], $this->lngModules()['common']);
302 $this->assertSame(['value' => 'Ja', 'local_change' => null], $this->lngData()['common|yes']);
303 $this->assertStringContainsString('Duplicate language entries for language "de"', $this->loggedWarnings());
304 $this->assertStringContainsString('common#:#yes', $this->loggedWarnings());
305 }
manager(?\Closure $client_data_dir_resolver=null, ?\Closure $language_cache_invalidator=null, bool $with_resolver=true, bool $with_logger=true, ?LoggerInterface $logger=null)

References LanguageInstallationManagerMigratedModulesTestCase\expectManagerWarning(), LanguageInstallationManagerMigratedModulesTestCase\lngData(), LanguageInstallationManagerMigratedModulesTestCase\lngModules(), LanguageInstallationManagerMigratedModulesTestCase\loggedWarnings(), LanguageInstallationManagerMigratedModulesTestCase\manager(), and LanguageInstallationManagerMigratedModulesTestCase\writeLang().

+ Here is the call graph for this function:

◆ testAFailingCacheInvalidatorIsLoggedAndSwallowed()

LanguageInstallationManagerMigratedAfterWriteTest::testAFailingCacheInvalidatorIsLoggedAndSwallowed ( )

Definition at line 91 of file LanguageInstallationManagerMigratedAfterWriteTest.php.

91 : void
92 {
93 $this->expectManagerWarning();
94 $this->shipPo(['greeting' => 'Hallo']);
95 $this->seedOverlay(['greeting' => ['value' => 'Hallo', 'original' => 'Hallo']]);
96
97 $this->manager(null, static function (): void {
98 throw new RuntimeException('cache is down');
99 })->insertLanguageForInstallation('de');
100
101 $this->assertSame(['greeting' => 'Hallo'], $this->lngModules()[self::MODULE]);
102 // a shipped value writes no file; the sync still running shows in the removal of an outdated overlay
103 $this->assertFileDoesNotExist(MigratedPoFixture::overlayMo($this->overlayBase()), 'the overlay sync still ran: it removed the outdated overlay');
104 $this->assertStringContainsString('cache is down', $this->loggedWarnings());
105 }
static overlayMo(string $base_path)
The compiled catalog of the revision current names; a non-existing path if there is none.

References LanguageInstallationManagerMigratedModulesTestCase\expectManagerWarning(), LanguageInstallationManagerMigratedModulesTestCase\lngModules(), LanguageInstallationManagerMigratedModulesTestCase\loggedWarnings(), LanguageInstallationManagerMigratedModulesTestCase\manager(), LanguageInstallationManagerMigratedModulesTestCase\overlayBase(), MigratedPoFixture\overlayMo(), LanguageInstallationManagerMigratedModulesTestCase\seedOverlay(), and LanguageInstallationManagerMigratedModulesTestCase\shipPo().

+ Here is the call graph for this function:

◆ testAModuleArrayThatCannotBeReadBackThrowsLanguageDataNotSaved()

LanguageInstallationManagerMigratedAfterWriteTest::testAModuleArrayThatCannotBeReadBackThrowsLanguageDataNotSaved ( )

Definition at line 36 of file LanguageInstallationManagerMigratedAfterWriteTest.php.

36 : void
37 {
38 $this->shipPo(['greeting' => 'Hallo']);
39 $this->collation_rows = [
40 ['module' => 'common', 'lang_array' => serialize(['yes' => 'Ja'])],
41 ['module' => self::MODULE, 'lang_array' => 'a:1:{s:8:"greeting";s:5:"Hal'],
42 ];
43 $invalidated = [];
44 $cwd = getcwd();
45
46 try {
47 $this->manager(null, static function (string $lang_key) use (&$invalidated): void {
48 $invalidated[] = $lang_key;
49 })->insertLanguageForInstallation('de');
50 $this->fail('Expected a LanguageDataNotSavedException');
52 $this->assertSame(409, $e->getCode());
53 $this->assertStringContainsString("'pilot'", $e->getMessage());
54 $this->assertStringContainsString("'de'", $e->getMessage());
55 }
56
57 $this->assertSame([], $invalidated, 'no cache invalidation for data that was not saved correctly');
58 $this->assertFileDoesNotExist($this->overlayBase() . '.po', 'no overlay for data that was not saved correctly');
59 $this->assertSame($cwd, getcwd(), 'the working directory is restored on the exception path');
60 // counts only the collation query of the lng_modules write; migratedModuleRemarks() issues its own lng_data SELECT beforehand
61 $collation_query = array_values(array_filter(
62 $this->queries,
63 static fn(string $q): bool => str_starts_with($q, 'SELECT') && str_contains($q, 'lang_array') && str_contains($q, 'lng_modules')
64 ));
65 $this->assertCount(1, $collation_query);
66 $this->assertStringContainsString("module IN ('pilot')", $collation_query[0]);
67 }
The module array just written to lng_modules could not be read back - almost always a wrong collation...

References Vendor\Package\$e, LanguageInstallationManagerMigratedModulesTestCase\manager(), LanguageInstallationManagerMigratedModulesTestCase\MODULE, LanguageInstallationManagerMigratedModulesTestCase\overlayBase(), and LanguageInstallationManagerMigratedModulesTestCase\shipPo().

+ Here is the call graph for this function:

◆ testAnOverlaySyncFailureIsLoggedAndTheDatabaseWriteStays()

LanguageInstallationManagerMigratedAfterWriteTest::testAnOverlaySyncFailureIsLoggedAndTheDatabaseWriteStays ( )

Root-proof overlay failure (a file where the overlay's "lang" directory must be created): logged, the database write stays.

Definition at line 139 of file LanguageInstallationManagerMigratedAfterWriteTest.php.

139 : void
140 {
141 $this->expectManagerWarning();
142 $this->shipPo(['greeting' => 'Hallo']);
143 // a local change: only then an overlay has to be written (delta)
144 $this->db_local_changes = [self::MODULE => ['greeting' => 'Servus']];
145 rmdir($this->root . '/client-data');
146 mkdir($this->root . '/client-data');
147 file_put_contents($this->root . '/client-data/lang', 'not a directory');
148
149 set_error_handler(static fn(): bool => true, E_WARNING);
150 try {
151 $unwritten = $this->manager()->insertLanguageForInstallation('de');
152 } finally {
153 restore_error_handler();
154 }
155
156 $this->assertSame(['greeting' => 'Servus'], $this->lngModules()[self::MODULE]);
157 $this->assertStringContainsString('Could not sync migrated language file for module "pilot"', $this->loggedWarnings());
158 $this->assertSame([self::MODULE], $unwritten, 'the failed module is returned so callers can report it');
159 }

References LanguageInstallationManagerMigratedModulesTestCase\expectManagerWarning(), LanguageInstallationManagerMigratedModulesTestCase\lngModules(), LanguageInstallationManagerMigratedModulesTestCase\loggedWarnings(), LanguageInstallationManagerMigratedModulesTestCase\manager(), and LanguageInstallationManagerMigratedModulesTestCase\shipPo().

+ Here is the call graph for this function:

◆ testASerializedFalseIsAlsoDetectedAsNotSaved()

LanguageInstallationManagerMigratedAfterWriteTest::testASerializedFalseIsAlsoDetectedAsNotSaved ( )

Definition at line 69 of file LanguageInstallationManagerMigratedAfterWriteTest.php.

69 : void
70 {
71 $this->writeLang('lang/ilias_de.lang', ['common#:#yes#:#Ja']);
72 $this->collation_rows = [['module' => 'common', 'lang_array' => serialize(false)]];
73
74 $this->expectException(LanguageDataNotSavedException::class);
75 $this->manager()->insertLanguageForInstallation('de');
76 }

References LanguageInstallationManagerMigratedModulesTestCase\manager(), and LanguageInstallationManagerMigratedModulesTestCase\writeLang().

+ Here is the call graph for this function:

◆ testAThrowingLoggerFallsBackToThePhpErrorLogAndDoesNotAbortTheInstallation()

LanguageInstallationManagerMigratedAfterWriteTest::testAThrowingLoggerFallsBackToThePhpErrorLogAndDoesNotAbortTheInstallation ( )

Definition at line 120 of file LanguageInstallationManagerMigratedAfterWriteTest.php.

120 : void
121 {
122 $this->expectErrorLog();
123 $this->shipPo(['greeting' => 'Hallo']);
124 $logger = $this->createStub(\ILIAS\Logging\Logger\LoggerInterface::class);
125 $logger->method('warning')->willThrowException(new RuntimeException('logger is down'));
126
127 $this->manager(null, static function (): void {
128 throw new RuntimeException('cache is down');
129 }, true, true, $logger)->insertLanguageForInstallation('de');
130
131 $this->assertSame(['greeting' => 'Hallo'], $this->lngModules()[self::MODULE]);
132 $this->assertStringContainsString('cache is down', $this->errorLog());
133 }
errorLog()
What error_log() wrote during this test so far - PHPUnit redirects error_log to a capture file per te...
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.

References ILIAS\TestQuestionPool\ExportImport\Foundation\Export\$logger, LanguageInstallationManagerMigratedModulesTestCase\errorLog(), LanguageInstallationManagerMigratedModulesTestCase\lngModules(), LanguageInstallationManagerMigratedModulesTestCase\manager(), and LanguageInstallationManagerMigratedModulesTestCase\shipPo().

+ Here is the call graph for this function:

◆ testEveryWritePathReturnsNothingWhenTheOverlayWasWritten()

LanguageInstallationManagerMigratedAfterWriteTest::testEveryWritePathReturnsNothingWhenTheOverlayWasWritten ( string  $method,
bool  $writes_overlay 
)

Definition at line 189 of file LanguageInstallationManagerMigratedAfterWriteTest.php.

189 : void
190 {
191 $this->shipPo(['greeting' => 'Hallo']);
192 $this->writeLang('lang/ilias_de.lang', ['common#:#yes#:#Ja']);
193 $this->writeLang('lang/customizing/ilias_de.lang.local', ['pilot#:#greeting#:#Servus']);
194 $this->db_entries = [self::MODULE => ['greeting' => 'Hallo'], 'common' => ['yes' => 'Ja']];
195
196 $this->assertSame([], $this->manager()->$method('de'));
197 // only a path that keeps the customizing value writes an overlay
198 $this->assertSame($writes_overlay, is_file(MigratedPoFixture::overlayMo($this->overlayBase())));
199 }

References LanguageInstallationManagerMigratedModulesTestCase\manager(), LanguageInstallationManagerMigratedModulesTestCase\overlayBase(), MigratedPoFixture\overlayMo(), LanguageInstallationManagerMigratedModulesTestCase\shipPo(), and LanguageInstallationManagerMigratedModulesTestCase\writeLang().

+ Here is the call graph for this function:

◆ testEveryWritePathReturnsOnlyTheModulesWhoseOverlayCouldNotBeWritten()

LanguageInstallationManagerMigratedAfterWriteTest::testEveryWritePathReturnsOnlyTheModulesWhoseOverlayCouldNotBeWritten ( string  $method,
bool  $writes_overlay 
)

The same failure is returned by all three write paths - and only the migrated module whose overlay failed is listed, never a non-migrated one written in the same run.

Definition at line 166 of file LanguageInstallationManagerMigratedAfterWriteTest.php.

166 : void
167 {
168 if ($writes_overlay) {
169 $this->expectManagerWarning();
170 }
171 $this->shipPo(['greeting' => 'Hallo']);
172 $this->writeLang('lang/ilias_de.lang', ['common#:#yes#:#Ja']);
173 $this->writeLang('lang/customizing/ilias_de.lang.local', ['pilot#:#greeting#:#Servus']);
174 $this->db_entries = [self::MODULE => ['greeting' => 'Hallo'], 'common' => ['yes' => 'Ja']];
175 file_put_contents($this->root . '/client-data/lang', 'not a directory');
176
177 set_error_handler(static fn(): bool => true, E_WARNING);
178 try {
179 $unwritten = $this->manager()->$method('de');
180 } finally {
181 restore_error_handler();
182 }
183
184 // "remove local changes" leaves only shipped values: no overlay to write, nothing can fail
185 $this->assertSame($writes_overlay ? [self::MODULE] : [], $unwritten);
186 }

References LanguageInstallationManagerMigratedModulesTestCase\expectManagerWarning(), LanguageInstallationManagerMigratedModulesTestCase\manager(), LanguageInstallationManagerMigratedModulesTestCase\shipPo(), and LanguageInstallationManagerMigratedModulesTestCase\writeLang().

+ Here is the call graph for this function:

◆ testFindUnwritableOverlayDirectoriesChecksTheResolvedClientDataDir()

LanguageInstallationManagerMigratedAfterWriteTest::testFindUnwritableOverlayDirectoriesChecksTheResolvedClientDataDir ( )

Checked against the client data directory the instance maintains the overlay in (resolved at call time), for the migrated modules of the given languages only.

Definition at line 227 of file LanguageInstallationManagerMigratedAfterWriteTest.php.

227 : void
228 {
229 $this->shipPo(['greeting' => 'Hallo']);
230 $blocked = $this->root . '/blocked';
231 mkdir($blocked);
232 file_put_contents($blocked . '/lang', 'not a directory');
233 $target = $this->root . '/client-data';
234 $manager = $this->manager(static function () use (&$target): ?string {
235 return $target;
236 });
237
238 $this->assertSame([], $manager->findUnwritableOverlayDirectories(['de']));
239
240 $target = $blocked;
241 $this->assertSame([$blocked . '/lang/pilot/de'], $manager->findUnwritableOverlayDirectories(['de']));
242 $this->assertSame([], $manager->findUnwritableOverlayDirectories(['en']), 'pilot is not migrated for en');
243
244 $target = null;
245 $this->assertSame([], $manager->findUnwritableOverlayDirectories(['de']));
246 }

References ILIAS\Scripts\PHPStan\$target, LanguageInstallationManagerMigratedModulesTestCase\manager(), and LanguageInstallationManagerMigratedModulesTestCase\shipPo().

+ Here is the call graph for this function:

◆ testTheLanguageCacheIsInvalidatedWithTheLanguageKeyBeforeTheOverlayIsSynced()

LanguageInstallationManagerMigratedAfterWriteTest::testTheLanguageCacheIsInvalidatedWithTheLanguageKeyBeforeTheOverlayIsSynced ( )

@lang text

Definition at line 78 of file LanguageInstallationManagerMigratedAfterWriteTest.php.

78 : void
79 {
80 $this->shipPo(['greeting' => 'Hallo']);
81 $overlay_po = $this->overlayBase() . '.po';
82 $calls = [];
83
84 $this->manager(null, function (string $lang_key) use (&$calls, $overlay_po): void {
85 $calls[] = [$lang_key, count(array_filter($this->queries, static fn(string $q): bool => str_starts_with($q, 'INSERT INTO lng_modules'))), is_file($overlay_po)];
86 })->insertLanguageForInstallation('de');
87
88 $this->assertSame([['de', 1, false]], $calls, 'once, after the lng_modules write, before the overlay sync');
89 }

References LanguageInstallationManagerMigratedModulesTestCase\manager(), LanguageInstallationManagerMigratedModulesTestCase\overlayBase(), and LanguageInstallationManagerMigratedModulesTestCase\shipPo().

+ Here is the call graph for this function:

◆ testTheResolversClientDataDirIsUsedAndResolvedAtCallTime()

LanguageInstallationManagerMigratedAfterWriteTest::testTheResolversClientDataDirIsUsedAndResolvedAtCallTime ( )

Definition at line 248 of file LanguageInstallationManagerMigratedAfterWriteTest.php.

248 : void
249 {
250 $this->shipPo(['greeting' => 'Hallo']);
251 $elsewhere = $this->root . '/elsewhere';
252 mkdir($elsewhere);
253 $target = null;
254 $manager = $this->manager(static function () use (&$target): ?string {
255 return $target;
256 });
257
258 $target = $elsewhere;
259 // a local change, so there is an overlay to write (delta)
260 $this->db_local_changes = [self::MODULE => ['greeting' => 'Servus']];
261 $manager->insertLanguageForInstallation('de');
262
263 $this->assertFileExists(MigratedPoFixture::overlayMo($elsewhere . '/lang/pilot/de/pilot_de'));
264 $this->assertDirectoryDoesNotExist($this->root . '/client-data/lang');
265 }

References ILIAS\Scripts\PHPStan\$target, LanguageInstallationManagerMigratedModulesTestCase\manager(), MigratedPoFixture\overlayMo(), and LanguageInstallationManagerMigratedModulesTestCase\shipPo().

+ Here is the call graph for this function:

◆ testTheSameEntryInTwoDifferentFilesIsNotADuplicate()

LanguageInstallationManagerMigratedAfterWriteTest::testTheSameEntryInTwoDifferentFilesIsNotADuplicate ( )

Definition at line 307 of file LanguageInstallationManagerMigratedAfterWriteTest.php.

307 : void
308 {
309 $this->writeLang('lang/ilias_de.lang', ['common#:#yes#:#Ja']);
310 $this->writeLang('lang/customizing/ilias_de.lang.local', ['common#:#yes#:#Jawohl']);
311
312 $this->manager()->insertLanguageForInstallation('de');
313
314 $this->assertSame(['yes' => 'Jawohl'], $this->lngModules()['common']);
315 $this->assertStringNotContainsString('Duplicate', $this->loggedWarnings());
316 }

References LanguageInstallationManagerMigratedModulesTestCase\lngModules(), LanguageInstallationManagerMigratedModulesTestCase\loggedWarnings(), LanguageInstallationManagerMigratedModulesTestCase\manager(), and LanguageInstallationManagerMigratedModulesTestCase\writeLang().

+ Here is the call graph for this function:

◆ testWithoutALoggerAWarningGoesToThePhpErrorLog()

LanguageInstallationManagerMigratedAfterWriteTest::testWithoutALoggerAWarningGoesToThePhpErrorLog ( )

Definition at line 107 of file LanguageInstallationManagerMigratedAfterWriteTest.php.

107 : void
108 {
109 $this->expectErrorLog();
110 $this->shipPo(['greeting' => 'Hallo']);
111
112 $this->manager(null, static function (): void {
113 throw new RuntimeException('cache is down');
114 }, true, false)->insertLanguageForInstallation('de');
115
116 $this->assertStringContainsString('cache is down', $this->errorLog());
117 $this->assertSame([], $this->logged_warnings);
118 }

References LanguageInstallationManagerMigratedModulesTestCase\errorLog(), LanguageInstallationManagerMigratedModulesTestCase\manager(), and LanguageInstallationManagerMigratedModulesTestCase\shipPo().

+ Here is the call graph for this function:

◆ testWithoutClientDataDirNothingIsReturnedAsUnwritten()

LanguageInstallationManagerMigratedAfterWriteTest::testWithoutClientDataDirNothingIsReturnedAsUnwritten ( )

No overlay is maintained without client data directory - that is not a failure to report.

Definition at line 216 of file LanguageInstallationManagerMigratedAfterWriteTest.php.

216 : void
217 {
218 $this->shipPo(['greeting' => 'Hallo']);
219
220 $this->assertSame([], $this->manager(static fn(): ?string => null)->insertLanguageForInstallation('de'));
221 }

References LanguageInstallationManagerMigratedModulesTestCase\manager(), and LanguageInstallationManagerMigratedModulesTestCase\shipPo().

+ Here is the call graph for this function:

◆ testWithoutClientDataDirTheDatabaseIsWrittenButNoOverlay()

LanguageInstallationManagerMigratedAfterWriteTest::testWithoutClientDataDirTheDatabaseIsWrittenButNoOverlay ( bool  $with_resolver)

Definition at line 268 of file LanguageInstallationManagerMigratedAfterWriteTest.php.

268 : void
269 {
270 $this->shipPo(['greeting' => 'Hallo']);
271
272 $this->manager(static fn(): ?string => null, null, $with_resolver)->insertLanguageForInstallation('de');
273
274 $this->assertSame(['greeting' => 'Hallo'], $this->lngModules()[self::MODULE]);
275 $this->assertDirectoryDoesNotExist($this->root . '/client-data/lang');
276 }

References LanguageInstallationManagerMigratedModulesTestCase\lngModules(), LanguageInstallationManagerMigratedModulesTestCase\manager(), and LanguageInstallationManagerMigratedModulesTestCase\shipPo().

+ Here is the call graph for this function:

◆ writePaths()

static LanguageInstallationManagerMigratedAfterWriteTest::writePaths ( )
static
Returns
array<string, array<int, mixed>>

Definition at line 204 of file LanguageInstallationManagerMigratedAfterWriteTest.php.

204 : array
205 {
206 return [
207 'install/update' => ['insertLanguageForInstallation', true],
208 'remove local changes' => ['insertLanguageForRemovingLocalChanges', false],
209 'apply local changes' => ['insertLanguageForApplyingLocalChanges', true],
210 ];
211 }

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