修复国家设置,允许不设置任何国家,不做判断
This commit is contained in:
@@ -56,9 +56,16 @@ if ($tests['resolver_available']) {
|
||||
$tests['normalize_name'] = CountryCodeNormalizer::toAlpha2('United States') === 'US';
|
||||
$tests['allowlist_name'] = CountryAllowlist::isAllowed('United Kingdom', CountryAllowlist::parse('GB,US'));
|
||||
$tests['allowlist_fullwidth_comma'] = CountryAllowlist::isAllowed('BR', CountryAllowlist::parse('BR,CN'));
|
||||
$tests['allowlist_semicolon'] = CountryAllowlist::isAllowed('GB', CountryAllowlist::parse('US;GB;CA'));
|
||||
$tests['allowlist_country_name'] = CountryAllowlist::isAllowed('BR', CountryAllowlist::parse('Brazil,China'));
|
||||
if (!$tests['normalize_iso2'] || !$tests['normalize_name'] || !$tests['allowlist_name']
|
||||
|| !$tests['allowlist_fullwidth_comma'] || !$tests['allowlist_country_name']) {
|
||||
|| !$tests['allowlist_fullwidth_comma'] || !$tests['allowlist_semicolon'] || !$tests['allowlist_country_name']) {
|
||||
$ok = false;
|
||||
}
|
||||
|
||||
$tests['is_enabled_empty'] = CountryAllowlist::isEnabled('') === false;
|
||||
$tests['is_enabled_us'] = CountryAllowlist::isEnabled('US,GB') === true;
|
||||
if (!$tests['is_enabled_empty'] || !$tests['is_enabled_us']) {
|
||||
$ok = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user