Annotation of embedaddon/php/ext/mbstring/tests/mb_http_input.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: mb_http_input() 
                      3: --SKIPIF--
                      4: <?php
                      5: extension_loaded('mbstring') or die('skip mbstring not available');
                      6: (php_sapi_name()=='cgi') or die("skip sapi is not a cgi version");
                      7: die("skip disabled temporarily");
                      8: ?>
                      9: --POST--
                     10: a=日本語0123456789日本語カタカナひらがな
                     11: --GET--
                     12: b=日本語0123456789日本語カタカナひらがな
                     13: --FILE--
                     14: <?php
                     15: // TODO: This is not a real test.... Need to change so that it does real testing
                     16: //$debug = true;
                     17: ini_set('include_path', dirname(__FILE__));
                     18: include_once('common.inc');
                     19: 
                     20: $ini = ini_get('mbstring.http_input');
                     21: 
                     22: // It must be url encoded....
                     23: // echo vars
                     24: echo $_POST['a']."\n";
                     25: echo $_GET['b']."\n";
                     26: 
                     27: // Get encoding
                     28: $enc = mb_http_input('P');
                     29: 
                     30: // check
                     31: if (empty($ini)) {
                     32:        // Must be pass
                     33:        if ($enc === 'pass') {
                     34:                echo "OK\n";
                     35:        }
                     36:        else {
                     37:                echo "NG\n";
                     38:        }
                     39: }
                     40: else {
                     41:        // Some encoding
                     42:        echo "This heppens when php.ini-dist is not used\n";
                     43: }
                     44: 
                     45: ?>
                     46: 
                     47: --EXPECT--
                     48: 日本語0123456789日本語カタカナひらがな
                     49: 日本語0123456789日本語カタカナひらがな
                     50: OK
                     51: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>