Files
Twig/tests/Fixtures/functions/random_invalid_utf8.test
T

9 lines
327 B
Plaintext

--TEST--
"random" function with a string that is not valid UTF-8
--TEMPLATE--
{{ random(value) }}
--DATA--
return ['value' => "\xC3\x28abc"]
--EXCEPTION--
Twig\Error\RuntimeError: Unable to split the string passed to "random" into characters: Malformed UTF-8 characters, possibly incorrectly encoded in "index.twig" at line 2.