Annotation of embedaddon/php/ext/ctype/tests/ctype_upper_variation3.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test ctype_upper() function : usage variations - different strings
! 3: --SKIPIF--
! 4: <?php require_once('skipif.inc'); ?>
! 5: --FILE--
! 6: <?php
! 7: /* Prototype : bool ctype_upper(mixed $c)
! 8: * Description: Checks for uppercase character(s)
! 9: * Source code: ext/ctype/ctype.c
! 10: */
! 11:
! 12: /*
! 13: * Pass strings containing different character types to ctype_upper() to test
! 14: * which are considered valid uppercase character only strings
! 15: */
! 16:
! 17: echo "*** Testing ctype_upper() : usage variations ***\n";
! 18: $orig = setlocale(LC_CTYPE, "C");
! 19:
! 20: $values = array(
! 21: /*1*/ "This string contains just letters and spaces", // Simple string
! 22: "but this one contains some numbers too 123+456 = 678", // Mixed string
! 23: "",
! 24: " ",
! 25: /*5*/ "a",
! 26: "ABCXYZ",
! 27: "abcxyz",
! 28: "ABCXYZ123DEF456",
! 29: "abczyz123DEF456",
! 30: /*10*/ "\r\n",
! 31: "123",
! 32: "03F", // hexadecimal 'digits'
! 33: ")speci@! ch@r$(",
! 34: '@!$*',
! 35: /*15*/ 'ABC',
! 36: 'abc',
! 37: 'ABC123',
! 38: 'abc123',
! 39: 'abc123\n',
! 40: /*20*/ 'abc 123',
! 41: '',
! 42: ' ',
! 43: base64_decode("w4DDoMOHw6fDiMOo"), // non-ascii characters
! 44: "abcXYZ",
! 45: /*25*/ "ABC XYZ",
! 46: /*26*/ "ABC+EFG*XYZ",
! 47: );
! 48:
! 49: $iterator = 1;
! 50: foreach($values as $value) {
! 51: echo "\n-- Iteration $iterator --\n";
! 52: var_dump( ctype_upper($value) );
! 53: $iterator++;
! 54: };
! 55:
! 56: setlocale(LC_CTYPE, $orig);
! 57: ?>
! 58: ===DONE===
! 59: --EXPECTF--
! 60: *** Testing ctype_upper() : usage variations ***
! 61:
! 62: -- Iteration 1 --
! 63: bool(false)
! 64:
! 65: -- Iteration 2 --
! 66: bool(false)
! 67:
! 68: -- Iteration 3 --
! 69: bool(false)
! 70:
! 71: -- Iteration 4 --
! 72: bool(false)
! 73:
! 74: -- Iteration 5 --
! 75: bool(false)
! 76:
! 77: -- Iteration 6 --
! 78: bool(true)
! 79:
! 80: -- Iteration 7 --
! 81: bool(false)
! 82:
! 83: -- Iteration 8 --
! 84: bool(false)
! 85:
! 86: -- Iteration 9 --
! 87: bool(false)
! 88:
! 89: -- Iteration 10 --
! 90: bool(false)
! 91:
! 92: -- Iteration 11 --
! 93: bool(false)
! 94:
! 95: -- Iteration 12 --
! 96: bool(false)
! 97:
! 98: -- Iteration 13 --
! 99: bool(false)
! 100:
! 101: -- Iteration 14 --
! 102: bool(false)
! 103:
! 104: -- Iteration 15 --
! 105: bool(true)
! 106:
! 107: -- Iteration 16 --
! 108: bool(false)
! 109:
! 110: -- Iteration 17 --
! 111: bool(false)
! 112:
! 113: -- Iteration 18 --
! 114: bool(false)
! 115:
! 116: -- Iteration 19 --
! 117: bool(false)
! 118:
! 119: -- Iteration 20 --
! 120: bool(false)
! 121:
! 122: -- Iteration 21 --
! 123: bool(false)
! 124:
! 125: -- Iteration 22 --
! 126: bool(false)
! 127:
! 128: -- Iteration 23 --
! 129: bool(false)
! 130:
! 131: -- Iteration 24 --
! 132: bool(false)
! 133:
! 134: -- Iteration 25 --
! 135: bool(false)
! 136:
! 137: -- Iteration 26 --
! 138: bool(false)
! 139: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>