source: src/router/php7/ext/filter/tests/058.phpt @ 31874

Last change on this file since 31874 was 31874, checked in by brainslayer, 2 months ago

update php

File size: 2.1 KB
Line 
1--TEST--
2FILTER_VALIDATE_EMAIL unicode support (https://tools.ietf.org/html/rfc6531)
3--SKIPIF--
4<?php if (!extension_loaded("filter")) die("skip"); ?>
5--FILE--
6<?php
7$values = Array(
8'niceÀndsimple@example.com',
9'véry.çommon@example.com',
10'a.lîttle.lengthy.but.fiñe@dept.example.com',
11'dîsposable.style.émail.with+symbol@example.com',
12'other.émail-with-dash@example.com',
13'ÃŒser@[IPv6:2001:db8:1ff::a0b:dbd0]',
14'"verî.uñusual.@.uñusual.com"@example.com',
15'"verî.(),:;<>[]\".VERÎ.\"verî@\ \"verî\".unÌsual"@strange.example.com',
16'tést@example.com',
17'tést.child@example.com',
18'tést@xn--exmple-cua.com',
19'tést@xn----zfa.xe',
20'tést@subexample.wizard',
21'tést@[255.255.255.255]',
22'tést@[IPv6:2001:0db8:85a3:08d3:1319:8a2e:0370:7344]',
23'tést@[IPv6:2001::7344]',
24'tést@[IPv6:1111:2222:3333:4444:5555:6666:255.255.255.255]',
25'tést+reference@example.com',
26'ÌñîçÞðé@example.com',
27'"ÌñîçÞðé"@example.com',
28'Džnj੧ఘⅧ⒇৪@example.com',
29);
30foreach ($values as $value) {
31        var_dump(filter_var($value, FILTER_VALIDATE_EMAIL, FILTER_FLAG_EMAIL_UNICODE));
32}
33echo "Done\n";
34?>
35--EXPECT--
36string(26) "niceÀndsimple@example.com"
37string(25) "véry.çommon@example.com"
38string(44) "a.lîttle.lengthy.but.fiñe@dept.example.com"
39string(48) "dîsposable.style.émail.with+symbol@example.com"
40string(34) "other.émail-with-dash@example.com"
41string(35) "ÃŒser@[IPv6:2001:db8:1ff::a0b:dbd0]"
42string(43) ""verî.uñusual.@.uñusual.com"@example.com"
43string(74) ""verî.(),:;<>[]\".VERÎ.\"verî@\ \"verî\".unÌsual"@strange.example.com"
44string(17) "tést@example.com"
45string(23) "tést.child@example.com"
46string(24) "tést@xn--exmple-cua.com"
47string(18) "tést@xn----zfa.xe"
48string(23) "tést@subexample.wizard"
49string(23) "tést@[255.255.255.255]"
50string(52) "tést@[IPv6:2001:0db8:85a3:08d3:1319:8a2e:0370:7344]"
51string(23) "tést@[IPv6:2001::7344]"
52string(58) "tést@[IPv6:1111:2222:3333:4444:5555:6666:255.255.255.255]"
53string(27) "tést+reference@example.com"
54string(26) "ÌñîçÞðé@example.com"
55string(28) ""ÌñîçÞðé"@example.com"
56string(31) "Džnj੧ఘⅧ⒇৪@example.com"
57Done
Note: See TracBrowser for help on using the repository browser.