$theme,'source'=>$source,'revision'=>$revision] || prelandThemeResolve($theme === 'light' ? 'dark' : 'light') !== $theme) throw new RuntimeException('Canonical preference не побеждает fallback'); $checks++; } foreach ([null, [], false, 1, '', "v1:light:manual:$revision\n", 'v1:dark:other:'.$revision, 'v1:dark:manual:'.str_repeat('a',15), 'v1:dark:manual:'.str_repeat('a',65), str_repeat('a',129)] as $value) { $_COOKIE['theme_choice'] = $value; if (prelandThemePreference() !== null || prelandThemeResolve('light') !== 'light') throw new RuntimeException('Невалидная preference принята'); $checks++; } $source = file_get_contents(dirname(__DIR__) . '/components/form.php'); if (!str_contains($source, 'const shownTheme = window.ZoomzillaTheme.current();') || !str_contains($source, "targetUrl += '&shown_theme=' + encodeURIComponent(shownTheme)")) throw new RuntimeException('Handoff должен читать показанную тему в момент навигации'); echo "OK: $checks standalone theme cases + dynamic shown_theme handoff\n";