Annotation of embedaddon/php/ext/mbstring/tests/mb_preferred_mime_name.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: mb_preferred_mime_name()
3: --SKIPIF--
4: <?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
5: --FILE--
6: <?php
7: // TODO: Add more encoding names
8:
9: //$debug=true;
10: ini_set('include_path', dirname(__FILE__));
11: include_once('common.inc');
12:
13:
14: $str = mb_preferred_mime_name('sjis-win');
15: echo "$str\n";
16:
17: $str = mb_preferred_mime_name('SJIS');
18: echo "$str\n";
19:
20: $str = mb_preferred_mime_name('EUC-JP');
21: echo "$str\n";
22:
23: $str = mb_preferred_mime_name('UTF-8');
24: echo "$str\n";
25:
26: $str = mb_preferred_mime_name('ISO-2022-JP');
27: echo "$str\n";
28:
29: $str = mb_preferred_mime_name('JIS');
30: echo "$str\n";
31:
32: $str = mb_preferred_mime_name('ISO-8859-1');
33: echo "$str\n";
34:
35: $str = mb_preferred_mime_name('UCS2');
36: echo "$str\n";
37:
38: $str = mb_preferred_mime_name('UCS4');
39: echo "$str\n";
40:
41: echo "== INVALID PARAMETER ==\n";
42: // Invalid name
43: $r = mb_preferred_mime_name('BAD_NAME');
44: ($r === FALSE) ? print("OK_BAD_NAME\n") : print("NG_BAD_NAME\n");
45:
46: ?>
47:
48: --EXPECT--
49: Shift_JIS
50: Shift_JIS
51: EUC-JP
52: UTF-8
53: ISO-2022-JP
54: ISO-2022-JP
55: ISO-8859-1
56: UCS-2
57: UCS-4
58: == INVALID PARAMETER ==
59: ERR: Warning
60: OK_BAD_NAME
61:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>