From: Zoe Slattery Date: Sun, 30 Aug 2009 12:19:50 +0000 (+0000) Subject: More tests from 2009 testfest X-Git-Tag: php-5.2.11RC2~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7aa125747efa86b9f030f0e3eab18b7594b9f292;p=php More tests from 2009 testfest --- diff --git a/ext/standard/tests/general_functions/get_cfg_var_variation1.phpt b/ext/standard/tests/general_functions/get_cfg_var_variation1.phpt new file mode 100644 index 0000000000..34e6cd612e --- /dev/null +++ b/ext/standard/tests/general_functions/get_cfg_var_variation1.phpt @@ -0,0 +1,46 @@ +--TEST-- +Test function get_cfg_var() by substituting argument 1 with array values. +--CREDITS-- +Francesco Fullone ff@ideato.it +#PHPTestFest Cesena Italia on 2009-06-20 +--INI-- +session.use_cookies=0 +session.serialize_handler=php +session.save_handler=files +--FILE-- + 'one', 2 => 'two'); + +$variation_array = array( + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + ); + + +foreach ( $variation_array as $var ) { + var_dump(get_cfg_var( $var ) ); +} +?> +--EXPECTF-- +*** Test substituting argument 1 with array values *** + +Notice: Array to string conversion in %s.php on line %d +bool(false) + +Notice: Array to string conversion in %s.php on line %d +bool(false) + +Notice: Array to string conversion in %s.php on line %d +bool(false) + +Notice: Array to string conversion in %s.php on line %d +bool(false) diff --git a/ext/standard/tests/general_functions/get_cfg_var_variation6.phpt b/ext/standard/tests/general_functions/get_cfg_var_variation6.phpt new file mode 100644 index 0000000000..39bdf80563 --- /dev/null +++ b/ext/standard/tests/general_functions/get_cfg_var_variation6.phpt @@ -0,0 +1,41 @@ +--TEST-- +Test function get_cfg_var() by substituting argument 1 with object values. +--CREDITS-- +Francesco Fullone ff@ideato.it +#PHPTestFest Cesena Italia on 2009-06-20 +--INI-- +session.use_cookies=0 +session.serialize_handler=php +session.save_handler=files +--FILE-- + new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + ); + + +foreach ( $variation_array as $var ) { + var_dump(get_cfg_var( $var ) ); +} +?> +--EXPECTF-- +*** Test substituting argument 1 with object values *** +string(1) "0" + +Catchable fatal error: Object of class classWithoutToString could not be converted to string in %s.php on line %d diff --git a/ext/standard/tests/general_functions/get_cfg_var_variation8.phpt b/ext/standard/tests/general_functions/get_cfg_var_variation8.phpt new file mode 100644 index 0000000000..22188c7e6c --- /dev/null +++ b/ext/standard/tests/general_functions/get_cfg_var_variation8.phpt @@ -0,0 +1,20 @@ +--TEST-- +Test function get_cfg_var() by calling deprecated option +--CREDITS-- +Francesco Fullone ff@ideato.it +#PHPTestFest Cesena Italia on 2009-06-20 +--INI-- +register_globals=1 +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +PHP Warning: Directive 'register_globals' is deprecated in PHP 5.3 and greater in %s on line 0 +*** Test by calling method or function with deprecated option *** +string(1) "1" + diff --git a/ext/standard/tests/general_functions/getservbyname_variation1.phpt b/ext/standard/tests/general_functions/getservbyname_variation1.phpt new file mode 100755 index 0000000000..27c2e7e03f --- /dev/null +++ b/ext/standard/tests/general_functions/getservbyname_variation1.phpt @@ -0,0 +1,40 @@ +--TEST-- +Test function getservbyname() by substituting argument 1 with array values. +--FILE-- + 'one', 2 => 'two'); + +$variation_array = array( + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + ); + + +foreach ( $variation_array as $var ) { + var_dump(getservbyname( $var , $protocol ) ); +} +?> +--EXPECTF-- +*** Test substituting argument 1 with array values *** + +Notice: Array to string conversion in %s.php on line %d +bool(false) + +Notice: Array to string conversion in %s.php on line %d +bool(false) + +Notice: Array to string conversion in %s.php on line %d +bool(false) + +Notice: Array to string conversion in %s.php on line %d +bool(false) diff --git a/ext/standard/tests/general_functions/getservbyname_variation13.phpt b/ext/standard/tests/general_functions/getservbyname_variation13.phpt new file mode 100755 index 0000000000..cf72600339 --- /dev/null +++ b/ext/standard/tests/general_functions/getservbyname_variation13.phpt @@ -0,0 +1,37 @@ +--TEST-- +Test function getservbyname() by substituting argument 2 with object values. +--FILE-- + new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + ); + + +foreach ( $variation_array as $var ) { + var_dump(getservbyname( $service, $var ) ); +} +?> +--EXPECTF-- +*** Test substituting argument 2 with object values *** +bool(false) + +Catchable fatal error: Object of class classWithoutToString could not be converted to string in %s.php on line %d diff --git a/ext/standard/tests/general_functions/getservbyname_variation6.phpt b/ext/standard/tests/general_functions/getservbyname_variation6.phpt new file mode 100755 index 0000000000..0a0ed595dc --- /dev/null +++ b/ext/standard/tests/general_functions/getservbyname_variation6.phpt @@ -0,0 +1,37 @@ +--TEST-- +Test function getservbyname() by substituting argument 1 with object values. +--FILE-- + new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + ); + + +foreach ( $variation_array as $var ) { + var_dump(getservbyname( $var , $protocol ) ); +} +?> +--EXPECTF-- +*** Test substituting argument 1 with object values *** +bool(false) + +Catchable fatal error: Object of class classWithoutToString could not be converted to string in %s.php on line %d diff --git a/ext/standard/tests/general_functions/getservbyname_variation8.phpt b/ext/standard/tests/general_functions/getservbyname_variation8.phpt new file mode 100755 index 0000000000..da936ed611 --- /dev/null +++ b/ext/standard/tests/general_functions/getservbyname_variation8.phpt @@ -0,0 +1,40 @@ +--TEST-- +Test function getservbyname() by substituting argument 2 with array values. +--FILE-- + 'one', 2 => 'two'); + +$variation_array = array( + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + ); + + +foreach ( $variation_array as $var ) { + var_dump(getservbyname( $service, $var ) ); +} +?> +--EXPECTF-- +*** Test substituting argument 2 with array values *** + +Notice: Array to string conversion in %s.php on line %d +bool(false) + +Notice: Array to string conversion in %s.php on line %d +bool(false) + +Notice: Array to string conversion in %s.php on line %d +bool(false) + +Notice: Array to string conversion in %s.php on line %d +bool(false)