File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / mbstring / tests / mb_http_input.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:47:57 2012 UTC (12 years, 5 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
php

--TEST--
mb_http_input() 
--SKIPIF--
<?php
extension_loaded('mbstring') or die('skip mbstring not available');
(php_sapi_name()=='cgi') or die("skip sapi is not a cgi version");
die("skip disabled temporarily");
?>
--POST--
a=日本語0123456789日本語カタカナひらがな
--GET--
b=日本語0123456789日本語カタカナひらがな
--FILE--
<?php
// TODO: This is not a real test.... Need to change so that it does real testing
//$debug = true;
ini_set('include_path', dirname(__FILE__));
include_once('common.inc');

$ini = ini_get('mbstring.http_input');

// It must be url encoded....
// echo vars
echo $_POST['a']."\n";
echo $_GET['b']."\n";

// Get encoding
$enc = mb_http_input('P');

// check
if (empty($ini)) {
	// Must be pass
	if ($enc === 'pass') {
		echo "OK\n";
	}
	else {
		echo "NG\n";
	}
}
else {
	// Some encoding
	echo "This heppens when php.ini-dist is not used\n";
}

?>

--EXPECT--
日本語0123456789日本語カタカナひらがな
日本語0123456789日本語カタカナひらがな
OK


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