From 2fbd7807717b11f281bd50138ca005b7dc660cdf Mon Sep 17 00:00:00 2001 From: Peter Hoffmann Date: Fri, 9 Jun 2017 14:45:45 +0200 Subject: [PATCH] Create test for unicode symbols This test is created b/c the same test with extensions would fail (see #317) --- tests/unicode.php | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 tests/unicode.php diff --git a/tests/unicode.php b/tests/unicode.php new file mode 100644 index 0000000..bdd3f57 --- /dev/null +++ b/tests/unicode.php @@ -0,0 +1,39 @@ +--TEST +Test V8::executeString() : Check if imported code works with umlauts +--SKIPIF-- + +--FILE-- +unicode = $unicode; + +# insert unicode via executeString +$jscript->executeString("var execStr = {unicode: '" . $unicode . "'}"); + +# return to php +$jscript->executeString("values = {}"); +$jscript->executeString("values['snapshot'] = snapshot.unicode"); +$jscript->executeString("values['php'] = php.unicode"); +$jscript->executeString("values['execStr'] = execStr.unicode"); +$values = $jscript->executeString("values", V8Js::FLAG_FORCE_ARRAY); + +echo "snapshot: $values->snapshot\n"; +echo "php : $values->php\n"; +echo "execStr : $values->execStr\n"; +?> +===EOF +--EXPECTF-- +snapshot: äöüßÜÄÖÜ߀áàâÁÀµ²³▁▂▃▄▅▆▇█    ㌀ ㌁ ㌂ ㌃ +php : äöüßÜÄÖÜ߀áàâÁÀµ²³▁▂▃▄▅▆▇█    ㌀ ㌁ ㌂ ㌃ +execStr : äöüßÜÄÖÜ߀áàâÁÀµ²³▁▂▃▄▅▆▇█    ㌀ ㌁ ㌂ ㌃ +===EOF===