1--TEST--
2Test mb_strtoupper() function : basic functionality
3--SKIPIF--
4<?php
5extension_loaded('mbstring') or die('skip');
6function_exists('mb_strtoupper') or die("skip mb_strtoupper() is not available in this build");
7?>
8--FILE--
9<?php
10/*
11 * Test basic functionality of mb_strtoupper
12 */
13
14echo "*** Testing mb_strtoupper() : basic functionality ***\n";
15
16mb_internal_encoding('utf-8');
17$ascii_lower = 'abcdefghijklmnopqrstuvwxyz';
18$ascii_upper = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
19$greek_lower = base64_decode('zrHOss6zzrTOtc62zrfOuM65zrrOu868zr3Ovs6/z4DPgc+Dz4TPhc+Gz4fPiM+J');
20$greek_upper = base64_decode('zpHOks6TzpTOlc6WzpfOmM6ZzprOm86czp3Ons6fzqDOoc6jzqTOpc6mzqfOqM6p');
21
22echo "\n-- ASCII String --\n";
23$ascii = mb_strtoupper($ascii_lower);
24var_dump(base64_encode($ascii));
25
26if($ascii == $ascii_upper) {
27    echo "Correctly converted\n";
28} else {
29    echo "Incorrectly converted\n";
30}
31
32echo "\n-- Multibyte String --\n";
33$mb = mb_strtoupper($greek_lower, 'UTF-8');
34var_dump(base64_encode($mb));
35
36if ($mb == $greek_upper) {
37    echo "Correctly converted\n";
38} else {
39    echo "Incorrectly converted\n";
40}
41
42echo "Done";
43?>
44--EXPECT--
45*** Testing mb_strtoupper() : basic functionality ***
46
47-- ASCII String --
48string(36) "QUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVo="
49Correctly converted
50
51-- Multibyte String --
52string(64) "zpHOks6TzpTOlc6WzpfOmM6ZzprOm86czp3Ons6fzqDOoc6jzqTOpc6mzqfOqM6p"
53Correctly converted
54Done
55