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/AdminDocumentationTerminolo...

31 lines
925 B
PHP

<?php
$root = dirname(__DIR__);
$documents = [
'captcha-configuration.md' => [
'old' => '配置文件 → 验证码设置',
'new' => '站点设置 → 验证码设置',
],
'registration-email-whitelist.md' => [
'old' => '配置文件 → 注册设置',
'new' => '站点设置 → 注册设置',
],
'china-ip-registration.md' => [
'old' => '后台配置文件页面',
'new' => '后台站点设置页面',
],
];
foreach ($documents as $name => $phrases) {
$contents = file_get_contents($root . '/docs/' . $name);
if (!is_string($contents)
|| str_contains($contents, $phrases['old'])
|| !str_contains($contents, $phrases['new'])) {
throw new RuntimeException(
$name . ' must use the current administrator navigation name.'
);
}
}
echo "Administrator documentation terminology contract passed.\n";