Annotation of embedaddon/php/ext/mbstring/tests/mb_strtolower_basic.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test mb_strtolower() function : basic functionality
3: --SKIPIF--
4: <?php
5: extension_loaded('mbstring') or die('skip');
6: function_exists('mb_strtolower') or die("skip mb_strtolower() is not available in this build");
7: ?>
8: --FILE--
9: <?php
10: /* Prototype : string mb_strtolower(string $sourcestring [, string $encoding])
11: * Description: Returns a lowercased version of $sourcestring
12: * Source code: ext/mbstring/mbstring.c
13: */
14:
15: /*
16: * Test basic functionality of mb_strtolower
17: */
18:
19: echo "*** Testing mb_strtolower() : basic functionality***\n";
20:
21: $ascii_lower = 'abcdefghijklmnopqrstuvwxyz';
22: $ascii_upper = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
23: $greek_lower = base64_decode('zrHOss6zzrTOtc62zrfOuM65zrrOu868zr3Ovs6/z4DPgc+Dz4TPhc+Gz4fPiM+J');
24: $greek_upper = base64_decode('zpHOks6TzpTOlc6WzpfOmM6ZzprOm86czp3Ons6fzqDOoc6jzqTOpc6mzqfOqM6p');
25:
26: echo "\n-- ASCII String --\n";
27: $ascii = mb_strtolower($ascii_upper);
28: var_dump($ascii);
29:
30: if($ascii == $ascii_lower) {
31: echo "Correctly converted\n";
32: } else {
33: echo "Incorrectly converted\n";
34: }
35:
36: echo "\n-- Multibyte String --\n";
37: $mb = mb_strtolower($greek_upper, 'UTF-8');
38: var_dump(base64_encode($mb));
39:
40: if ($mb == $greek_lower) {
41: echo "Correctly converted\n";
42: } else {
43: echo "Incorreclty converted\n";
44: }
45:
46: echo "Done";
47: ?>
48: --EXPECTF--
49: *** Testing mb_strtolower() : basic functionality***
50:
51: -- ASCII String --
52: string(26) "abcdefghijklmnopqrstuvwxyz"
53: Correctly converted
54:
55: -- Multibyte String --
56: string(64) "zrHOss6zzrTOtc62zrfOuM65zrrOu868zr3Ovs6/z4DPgc+Dz4TPhc+Gz4fPiM+J"
57: Correctly converted
58: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>