diff --git a/tests/Feature/Ai/AutofillBrandTest.php b/tests/Feature/Ai/AutofillBrandTest.php index e4be9ded..fd5469c0 100644 --- a/tests/Feature/Ai/AutofillBrandTest.php +++ b/tests/Feature/Ai/AutofillBrandTest.php @@ -100,13 +100,29 @@ expect($result->language)->toBe($expected); })->with([ + // Every supported language, detected from its primary subtag. + ['en', 'en'], ['pt', 'pt-BR'], + ['es', 'es'], + ['fr', 'fr'], + ['de', 'de'], + ['it', 'it'], + ['nl', 'nl'], + ['pl', 'pl'], + ['el', 'el'], + ['ja', 'ja'], + ['ko', 'ko'], + ['zh', 'zh'], + ['ru', 'ru'], + ['tr', 'tr'], + ['ar', 'ar'], + // Region/script subtags still resolve to the supported language. ['pt-PT', 'pt-BR'], ['en-US', 'en'], ['es-MX', 'es'], - ['fr', 'fr'], ['ja-JP', 'ja'], ['zh-Hans', 'zh'], + // Unsupported languages stay null. ['sv', null], ]); diff --git a/tests/Unit/Enums/Workspace/ContentLanguageTest.php b/tests/Unit/Enums/Workspace/ContentLanguageTest.php index 525d66d1..58db5692 100644 --- a/tests/Unit/Enums/Workspace/ContentLanguageTest.php +++ b/tests/Unit/Enums/Workspace/ContentLanguageTest.php @@ -44,4 +44,7 @@ ['sv', null], ['e', null], ['', null], + // A malformed tag is matched on its whole primary subtag, never a + // two-letter prefix — "english" must not resolve to English via "en". + ['english', null], ]);