You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
virt/web/tests/AdminSiteSettingsNamingTest...

34 lines
1.3 KiB
PHP

<?php
$root = dirname(__DIR__);
$header = file_get_contents(
$root . '/resources/views/venix/admin/static_header.tpl'
);
$config = file_get_contents(
$root . '/resources/views/venix/admin/config.tpl'
);
$docs = file_get_contents(dirname($root)
. '/docs/MULTI_PUBLIC_IPV4_POOLS.md');
$assert = static function (bool $condition, string $message): void {
if (!$condition) {
throw new RuntimeException($message);
}
};
$assert(is_string($header) && is_string($config) && is_string($docs),
'Administrator site settings sources could not be read.');
$assert(str_contains($header, 'href="/admin/config"')
&& str_contains($header, '<span>站点设置</span>')
&& !str_contains($header, '<span>配置文件</span>'),
'The administrator navigation must call the online settings page site settings.');
$assert(str_contains($config, "admin_title value='站点设置'")
&& str_contains($config, '>站点设置</h4>')
&& !str_contains($config, "admin_title value='配置文件'")
&& !str_contains($config, '>配置文件</h4>'),
'The site settings page still uses the misleading configuration-file title.');
$assert(str_contains($docs, '站点设置 → 云实例计费'),
'Administrator navigation documentation is not aligned with the new label.');
echo "Administrator site settings naming checks passed.\n";