~ubuntu-branches/ubuntu/hardy/php5/hardy-updates

« back to all changes in this revision

Viewing changes to ext/mbstring/tests/mb_http_input.phpt

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-10-09 03:14:32 UTC
  • Revision ID: james.westby@ubuntu.com-20051009031432-kspik3lobxstafv9
Tags: upstream-5.0.5
Import upstream version 5.0.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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','.');
 
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