Annotation of embedaddon/php/ext/filter/tests/011.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: input_get()
! 3: --INI--
! 4: precision=14
! 5: --SKIPIF--
! 6: <?php if (!extension_loaded("filter")) die("skip"); ?>
! 7: --GET--
! 8: a=<b>test</b>&b=http://example.com
! 9: --POST--
! 10: c=<p>string</p>&d=12345.7
! 11: --FILE--
! 12: <?php
! 13: ini_set('html_errors', false);
! 14: var_dump(filter_input(INPUT_GET, "a", FILTER_SANITIZE_STRIPPED));
! 15: var_dump(filter_input(INPUT_GET, "b", FILTER_SANITIZE_URL));
! 16: var_dump(filter_input(INPUT_GET, "a", FILTER_SANITIZE_SPECIAL_CHARS, array(1,2,3,4,5)));
! 17: var_dump(filter_input(INPUT_GET, "b", FILTER_VALIDATE_FLOAT, new stdClass));
! 18: var_dump(filter_input(INPUT_POST, "c", FILTER_SANITIZE_STRIPPED, array(5,6,7,8)));
! 19: var_dump(filter_input(INPUT_POST, "d", FILTER_VALIDATE_FLOAT));
! 20: var_dump(filter_input(INPUT_POST, "c", FILTER_SANITIZE_SPECIAL_CHARS));
! 21: var_dump(filter_input(INPUT_POST, "d", FILTER_VALIDATE_INT));
! 22:
! 23: var_dump(filter_var(new stdClass, "d"));
! 24:
! 25: var_dump(filter_input(INPUT_POST, "c", "", ""));
! 26: var_dump(filter_var("", "", "", "", ""));
! 27: var_dump(filter_var(0, 0, 0, 0, 0));
! 28:
! 29: echo "Done\n";
! 30: ?>
! 31: --EXPECTF--
! 32: string(4) "test"
! 33: string(18) "http://example.com"
! 34: string(27) "<b>test</b>"
! 35:
! 36: Notice: Object of class stdClass could not be converted to int in %s011.php on line %d
! 37: bool(false)
! 38: string(6) "string"
! 39: float(12345.7)
! 40: string(29) "<p>string</p>"
! 41: bool(false)
! 42:
! 43: Warning: filter_var() expects parameter 2 to be long, string given in %s011.php on line %d
! 44: NULL
! 45:
! 46: Warning: filter_input() expects parameter 3 to be long, string given in %s011.php on line %d
! 47: NULL
! 48:
! 49: Warning: filter_var() expects at most 3 parameters, 5 given in %s011.php on line %d
! 50: NULL
! 51:
! 52: Warning: filter_var() expects at most 3 parameters, 5 given in %s011.php on line %d
! 53: NULL
! 54: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>