fix(config): enable explicit face focus
deploy-preland / deploy barbariskatest (push) Skipped
deploy-preland / deploy zoomstage.online (push) Successful in 33s
deploy-preland / deploy zoompixel.online (push) Skipped
deploy-preland / deploy zoompixel.ru (push) Skipped

This commit is contained in:
Panfilov Konstantin committed 2026-10-17 19:25:05 +03:00
1 parent ed1e476cc6
commit 356eeb9806
5 files changed
+64 -18

No files matched your search

+39
View File
@@ -0,0 +1,39 @@
<?php
/** Регрессия правила: deploy меняет только явно согласованный ключ focus. */
declare(strict_types=1);
$root = dirname(__DIR__);
$script = $root . '/bin/ensure-focus-config.php';
$fixture = [
'host' => 'custom.example',
'requisites' => ['Не менять'],
'utm' => [
'theme' => ['weights' => ['dark' => 7, 'light' => 3], 'default' => 'light'],
'focus' => ['weights' => ['center' => 9, 'face' => 1], 'default' => 'center'],
],
];
$path = tempnam(sys_get_temp_dir(), 'preland-config-');
if ($path === false) {
fwrite(STDERR, "FAIL: не создан временный config.\n");
exit(1);
}
try {
file_put_contents($path, json_encode($fixture, JSON_THROW_ON_ERROR));
exec(PHP_BINARY . ' ' . escapeshellarg($script) . ' ' . escapeshellarg($path), $output, $code);
$actual = json_decode((string) file_get_contents($path), true, 512, JSON_THROW_ON_ERROR);
} finally {
@unlink($path);
}
if ($code !== 10
|| ($actual['host'] ?? null) !== 'custom.example'
|| ($actual['requisites'] ?? null) !== ['Не менять']
|| ($actual['utm']['theme'] ?? null) !== $fixture['utm']['theme']
|| ($actual['utm']['focus'] ?? null) !== ['weights' => ['center' => 0, 'face' => 1], 'default' => 'face']) {
fwrite(STDERR, "FAIL: host-config должен сохранить все значения, кроме явно заданного focus.\n");
exit(1);
}
fwrite(STDOUT, "OK: host config changes only explicit focus\n");