mivita/tests/Feature/LocalizationSyncTest.php
Kevin 65b867f8ee Abo Einmalprodukte: Phasen 5-7, konfigurierbare Sperrfristen, Lokalisierung & Dashboard
Rechnung/Lieferschein:
- PDF-Gruppierung Abo- vs. Einmal-Artikel (is_abo_addon), rueckwaertskompatibel
- Vorschau-Command sales:preview-invoice (umgeht Test-System-Gate, ohne Rechnungsnummer)

Reminder-Mail (vorbereitet, Cron inaktiv):
- MailAboExecutionReminder + Template, abo:send-execution-reminder, Spalte onetime_reminder_sent_for
- Berater -> Sales Center, Kunde -> Portal; Vorschau abo:preview-reminder
- Datum-Fix: formatDateDB() statt formatDate() (ICU-Format)

Sperrfristen konfigurierbar (Admin-Settings):
- abo-lock-days-change (Liefertag + Abo-Produkte), abo-lock-days-pause-cancel
- Meldungen mit :lock-Platzhalter; Pausieren/Kuendigen vom Change-Lock entkoppelt
- Abo-Produkt-Aenderungen im Lock-Fenster server- + clientseitig eingefroren
- Selbstbedienung: Add-only/Lock nach $view (kein Admin-Bypass), Stale-Cache-Fix beim Mengen-Update

Dashboard:
- Einmalprodukte-Card + Team-Abo-KPI-Card, News-Card responsiv (col-xl-6)

Lokalisierung:
- Sprachdateien en/es/fr vollstaendig mit de synchronisiert (inkl. marketingplan/portal)
- LocalizationSyncTest sichert Key-Gleichheit ab

Tests: AboOneTimeInvoiceGrouping, AboExecutionReminder, AboLockDaysSetting,
AboOnetimeDashboardAndMail, PreviewInvoiceCommand, TeamAboOverview + erweiterte View-Tests

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 13:38:11 +00:00

41 lines
1.2 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
uses(Tests\TestCase::class);
/**
* Stellt sicher, dass alle Übersetzungsdateien (en/es/fr) exakt dieselben Keys
* wie die deutsche Quelle haben – keine fehlenden und keine überzähligen Keys.
* Deutsch ist die maßgebliche Quelle.
*/
it('keeps translation files in sync with the german source keys', function (string $locale) {
foreach (glob(resource_path('lang/de/*.php')) as $germanFile) {
$fileName = basename($germanFile);
$localeFile = resource_path('lang/'.$locale.'/'.$fileName);
expect($localeFile)->toBeFile("Datei {$fileName} fehlt für Locale {$locale}");
expect(localizationSyncFlattenKeys(require $localeFile))
->toEqualCanonicalizing(localizationSyncFlattenKeys(require $germanFile));
}
})->with(['en', 'es', 'fr']);
/**
* @return array<int, string>
*/
function localizationSyncFlattenKeys(array $translations, string $prefix = ''): array
{
$keys = [];
foreach ($translations as $key => $value) {
$translationKey = $prefix.(string) $key;
if (is_array($value)) {
$keys = [...$keys, ...localizationSyncFlattenKeys($value, $translationKey.'.')];
continue;
}
$keys[] = $translationKey;
}
return $keys;
}