]> scripts.mit.edu Git - autoinstalls/mediawiki.git/blob - vendor/pear/mail_mime/tests/test_Bug_21206.phpt
MediaWiki 1.30.2
[autoinstalls/mediawiki.git] / vendor / pear / mail_mime / tests / test_Bug_21206.phpt
1 --TEST--
2 Bug #21206  Handling quoted strings
3 --SKIPIF--
4 --FILE--
5 <?php
6 require_once('Mail/mimePart.php');
7 class X extends Mail_mimePart {
8     public static function explodeQuotedString($delimiter, $string){
9         return Mail_mimePart::explodeQuotedString($delimiter, $string);
10     }
11 }
12
13 $tests = [
14     '"a" <a@a.a>, b <b@b.b>',
15     '"c\\\\" <c@c.c>, d <d@d.d>',
16 ];
17 foreach ($tests as $test) {
18     $addrs = X::explodeQuotedString('[\t,]', $test);
19     foreach ($addrs as $addr) {
20         print trim($addr) . PHP_EOL;
21     }
22 }
23 ?>
24 --EXPECT--
25 "a" <a@a.a>
26 b <b@b.b>
27 "c\\" <c@c.c>
28 d <d@d.d>