Added more tests covering unicode in custom slugs

This commit is contained in:
Alejandro Celaya 2020-12-02 18:38:23 +01:00
parent 9857f105ec
commit 6bedca4ee6
2 changed files with 6 additions and 0 deletions

View File

@ -54,6 +54,7 @@ class ShortUrlMetaInputFilter extends InputFilter
$customSlug->getFilterChain()->attach(new Validation\SluggerFilter(new CocurSymfonySluggerBridge(new Slugify([
'regexp' => CUSTOM_SLUGS_REGEXP,
'lowercase' => false, // We want to keep it case sensitive
'rulesets' => ['default'],
]))));
$customSlug->getValidatorChain()->attach(new Validator\NotEmpty([
Validator\NotEmpty::STRING,

View File

@ -88,5 +88,10 @@ class ShortUrlMetaTest extends TestCase
yield ['wp-admin.php', 'wp-admin.php'];
yield ['UPPER_lower', 'UPPER_lower'];
yield ['more~url_special.chars', 'more~url_special.chars'];
yield ['äéñ', 'äen'];
yield ['구글', '구글'];
yield ['グーグル', 'グーグル'];
yield ['谷歌', '谷歌'];
yield ['гугл', 'гугл'];
}
}