mirror of
https://github.com/php/php-src.git
synced 2024-11-30 13:25:43 +08:00
Remove more zpp error tests
This commit is contained in:
parent
e907fbaf7c
commit
10b4113638
@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
Hash: hash_copy() errors
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$r = hash_init("md5");
|
||||
var_dump(hash_copy());
|
||||
var_dump(hash_copy($r));
|
||||
var_dump(hash_copy($r, $r));
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: hash_copy() expects exactly 1 parameter, 0 given in %s on line %d
|
||||
NULL
|
||||
object(HashContext)#%d (0) {
|
||||
}
|
||||
|
||||
Warning: hash_copy() expects exactly 1 parameter, 2 given in %s on line %d
|
||||
NULL
|
||||
Done
|
@ -1,45 +0,0 @@
|
||||
--TEST--
|
||||
Test iconv_strlen() function : error conditions - pass incorrect number of args
|
||||
--SKIPIF--
|
||||
<?php
|
||||
extension_loaded('iconv') or die('skip');
|
||||
function_exists('iconv_strlen') or die("skip iconv_strlen() is not available in this build");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
/* Prototype : int iconv_strlen(string str [, string charset])
|
||||
* Description: Get character numbers of a string
|
||||
* Source code: ext/iconv/iconv.c
|
||||
*/
|
||||
|
||||
/*
|
||||
* Pass iconv_strlen an incorrect number of arguments to test behaviour
|
||||
*/
|
||||
|
||||
echo "*** Testing iconv_strlen() : error conditions ***\n";
|
||||
|
||||
// Zero arguments
|
||||
echo "\n-- Testing iconv_strlen() function with Zero arguments --\n";
|
||||
var_dump( iconv_strlen() );
|
||||
|
||||
//Test iconv_strlen with one more than the expected number of arguments
|
||||
echo "\n-- Testing iconv_strlen() function with more than expected no. of arguments --\n";
|
||||
$str = 'string_val';
|
||||
$encoding = 'string_val';
|
||||
$extra_arg = 10;
|
||||
var_dump( iconv_strlen($str, $encoding, $extra_arg) );
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
*** Testing iconv_strlen() : error conditions ***
|
||||
|
||||
-- Testing iconv_strlen() function with Zero arguments --
|
||||
|
||||
Warning: iconv_strlen() expects at least 1 parameter, 0 given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- Testing iconv_strlen() function with more than expected no. of arguments --
|
||||
|
||||
Warning: iconv_strlen() expects at most 2 parameters, 3 given in %s on line %d
|
||||
bool(false)
|
||||
===DONE===
|
@ -1,50 +0,0 @@
|
||||
--TEST--
|
||||
Test iconv_strpos() function : error conditions - Pass incorrect number of args
|
||||
--SKIPIF--
|
||||
<?php
|
||||
extension_loaded('iconv') or die('skip');
|
||||
function_exists('iconv_strpos') or die("skip iconv_strpos() is not available in this build");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
/* Prototype : int iconv_strpos(string haystack, string needle [, int offset [, string charset]])
|
||||
* Description: Find position of first occurrence of a string within another
|
||||
* Source code: ext/iconv/iconv.c
|
||||
*/
|
||||
|
||||
/*
|
||||
* Test how iconv_strpos behaves when passed an incorrect number of arguments
|
||||
*/
|
||||
|
||||
echo "*** Testing iconv_strpos() : error conditions ***\n";
|
||||
|
||||
|
||||
//Test iconv_strpos with one more than the expected number of arguments
|
||||
echo "\n-- Testing iconv_strpos() function with more than expected no. of arguments --\n";
|
||||
$haystack = 'string_val';
|
||||
$needle = 'string_val';
|
||||
$offset = 10;
|
||||
$encoding = 'string_val';
|
||||
$extra_arg = 10;
|
||||
var_dump( iconv_strpos($haystack, $needle, $offset, $encoding, $extra_arg) );
|
||||
|
||||
// Testing iconv_strpos with one less than the expected number of arguments
|
||||
echo "\n-- Testing iconv_strpos() function with less than expected no. of arguments --\n";
|
||||
$haystack = 'string_val';
|
||||
var_dump( iconv_strpos($haystack) );
|
||||
|
||||
echo "Done";
|
||||
?>
|
||||
--EXPECTF--
|
||||
*** Testing iconv_strpos() : error conditions ***
|
||||
|
||||
-- Testing iconv_strpos() function with more than expected no. of arguments --
|
||||
|
||||
Warning: iconv_strpos() expects at most 4 parameters, 5 given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- Testing iconv_strpos() function with less than expected no. of arguments --
|
||||
|
||||
Warning: iconv_strpos() expects at least 2 parameters, 1 given in %s on line %d
|
||||
bool(false)
|
||||
Done
|
@ -1,49 +0,0 @@
|
||||
--TEST--
|
||||
Test iconv_strrpos() function : error conditions - pass incorrect number of args
|
||||
--SKIPIF--
|
||||
<?php
|
||||
extension_loaded('iconv') or die('skip');
|
||||
function_exists('iconv_strrpos') or die("skip iconv_strrpos() is not available in this build");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
/* Prototype : proto int iconv_strrpos(string haystack, string needle [, string charset])
|
||||
* Description: Find position of last occurrence of a string within another
|
||||
* Source code: ext/iconv/iconv.c
|
||||
*/
|
||||
|
||||
/*
|
||||
* Pass iconv_strrpos() an incorrect number of arguments
|
||||
*/
|
||||
|
||||
echo "*** Testing iconv_strrpos() : error conditions ***\n";
|
||||
|
||||
|
||||
//Test iconv_strrpos with one more than the expected number of arguments
|
||||
echo "\n-- Testing iconv_strrpos() function with more than expected no. of arguments --\n";
|
||||
$haystack = 'string_val';
|
||||
$needle = 'string_val';
|
||||
$encoding = 'string_val';
|
||||
$extra_arg = 10;
|
||||
var_dump( iconv_strrpos($haystack, $needle, $encoding, $extra_arg) );
|
||||
|
||||
// Testing iconv_strrpos with one less than the expected number of arguments
|
||||
echo "\n-- Testing iconv_strrpos() function with less than expected no. of arguments --\n";
|
||||
$haystack = 'string_val';
|
||||
var_dump( iconv_strrpos($haystack) );
|
||||
|
||||
echo "Done";
|
||||
?>
|
||||
--EXPECTF--
|
||||
*** Testing iconv_strrpos() : error conditions ***
|
||||
|
||||
-- Testing iconv_strrpos() function with more than expected no. of arguments --
|
||||
|
||||
Warning: iconv_strrpos() expects at most 3 parameters, 4 given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- Testing iconv_strrpos() function with less than expected no. of arguments --
|
||||
|
||||
Warning: iconv_strrpos() expects at least 2 parameters, 1 given in %s on line %d
|
||||
bool(false)
|
||||
Done
|
@ -1,49 +0,0 @@
|
||||
--TEST--
|
||||
Test iconv_substr() function : error conditions - Pass incorrect number of args
|
||||
--SKIPIF--
|
||||
<?php
|
||||
extension_loaded('iconv') or die('skip');
|
||||
function_exists('iconv_substr') or die("skip iconv_substr() is not available in this build");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
/* Prototype : string iconv_substr(string str, int offset, [int length, string charset])
|
||||
* Description: Returns part of a string
|
||||
* Source code: ext/iconv/iconv.c
|
||||
*/
|
||||
|
||||
/*
|
||||
* Pass incorrect number of arguments to iconv_substr() to test behaviour
|
||||
*/
|
||||
|
||||
echo "*** Testing iconv_substr() : error conditions ***\n";
|
||||
|
||||
//Test iconv_substr with one more than the expected number of arguments
|
||||
echo "\n-- Testing iconv_substr() function with more than expected no. of arguments --\n";
|
||||
$str = 'string_val';
|
||||
$start = 10;
|
||||
$length = 10;
|
||||
$encoding = 'string_val';
|
||||
$extra_arg = 10;
|
||||
var_dump( iconv_substr($str, $start, $length, $encoding, $extra_arg) );
|
||||
|
||||
// Testing iconv_substr with one less than the expected number of arguments
|
||||
echo "\n-- Testing iconv_substr() function with less than expected no. of arguments --\n";
|
||||
$str = 'string_val';
|
||||
var_dump( iconv_substr($str) );
|
||||
|
||||
echo "Done";
|
||||
?>
|
||||
--EXPECTF--
|
||||
*** Testing iconv_substr() : error conditions ***
|
||||
|
||||
-- Testing iconv_substr() function with more than expected no. of arguments --
|
||||
|
||||
Warning: iconv_substr() expects at most 4 parameters, 5 given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
-- Testing iconv_substr() function with less than expected no. of arguments --
|
||||
|
||||
Warning: iconv_substr() expects at least 2 parameters, 1 given in %s on line %d
|
||||
bool(false)
|
||||
Done
|
@ -1,43 +0,0 @@
|
||||
--TEST--
|
||||
Test preg_grep() function : error conditions - wrong numbers of parameters
|
||||
--FILE--
|
||||
<?php
|
||||
/*
|
||||
* proto array preg_grep(string regex, array input [, int flags])
|
||||
* Function is implemented in ext/pcre/php_pcre.c
|
||||
*/
|
||||
echo "*** Testing preg_grep() : error conditions ***\n";
|
||||
// Zero arguments
|
||||
echo "\n-- Testing preg_grep() function with Zero arguments --\n";
|
||||
var_dump(preg_grep());
|
||||
//Test preg_grep with one more than the expected number of arguments
|
||||
echo "\n-- Testing preg_grep() function with more than expected no. of arguments --\n";
|
||||
$regex = '/\d/';
|
||||
$input = array(1, 2);
|
||||
$flags = 0;
|
||||
$extra_arg = 10;
|
||||
var_dump(preg_grep($regex, $input, $flags, $extra_arg));
|
||||
// Testing preg_grep withone less than the expected number of arguments
|
||||
echo "\n-- Testing preg_grep() function with less than expected no. of arguments --\n";
|
||||
$regex = 'string_val';
|
||||
var_dump(preg_grep($regex));
|
||||
echo "Done"
|
||||
?>
|
||||
--EXPECTF--
|
||||
*** Testing preg_grep() : error conditions ***
|
||||
|
||||
-- Testing preg_grep() function with Zero arguments --
|
||||
|
||||
Warning: preg_grep() expects at least 2 parameters, 0 given in %spreg_grep_error.php on line %d
|
||||
NULL
|
||||
|
||||
-- Testing preg_grep() function with more than expected no. of arguments --
|
||||
|
||||
Warning: preg_grep() expects at most 3 parameters, 4 given in %spreg_grep_error.php on line %d
|
||||
NULL
|
||||
|
||||
-- Testing preg_grep() function with less than expected no. of arguments --
|
||||
|
||||
Warning: preg_grep() expects at least 2 parameters, 1 given in %spreg_grep_error.php on line %d
|
||||
NULL
|
||||
Done
|
@ -1,42 +0,0 @@
|
||||
--TEST--
|
||||
Test preg_grep() function : error conditions - wrong arg types
|
||||
--FILE--
|
||||
<?php
|
||||
/*
|
||||
* proto array preg_grep(string regex, array input [, int flags])
|
||||
* Function is implemented in ext/pcre/php_pcre.c
|
||||
*/
|
||||
error_reporting(E_ALL&~E_NOTICE);
|
||||
/*
|
||||
* Testing how preg_grep reacts to being passed the wrong type of input argument
|
||||
*/
|
||||
echo "*** Testing preg_grep() : error conditions ***\n";
|
||||
$regex = '/[a-zA-Z]/';
|
||||
$input = array('this is a string', array('this is', 'a subarray'),);
|
||||
foreach($input as $value) {
|
||||
print "\nArg value is: $value\n";
|
||||
var_dump(preg_grep($regex, $value));
|
||||
}
|
||||
$value = new stdclass(); //Object
|
||||
var_dump(preg_grep($regex, $value));
|
||||
echo "Done";
|
||||
?>
|
||||
--EXPECTF--
|
||||
*** Testing preg_grep() : error conditions ***
|
||||
|
||||
Arg value is: this is a string
|
||||
|
||||
Warning: preg_grep() expects parameter 2 to be array, string given in %spreg_grep_error2.php on line %d
|
||||
NULL
|
||||
|
||||
Arg value is: Array
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(7) "this is"
|
||||
[1]=>
|
||||
string(10) "a subarray"
|
||||
}
|
||||
|
||||
Warning: preg_grep() expects parameter 2 to be array, object given in %spreg_grep_error2.php on line %d
|
||||
NULL
|
||||
Done
|
@ -1,30 +0,0 @@
|
||||
--TEST--
|
||||
Test preg_grep() function : error conditions - wrong numbers of parameters
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/* Prototype : int preg_last_error ( void )
|
||||
* Description: Returns the error code of the last PCRE regex execution
|
||||
* Source code: ext/pcre/php_pcre.c
|
||||
*/
|
||||
|
||||
/*
|
||||
* Pass an incorrect number of arguments to preg_last_error() to test behaviour
|
||||
*/
|
||||
|
||||
echo "*** Testing preg_last_error() : error conditions ***\n";
|
||||
|
||||
// Test preg_last_error with one more than the expected number of arguments
|
||||
echo "\n-- Testing preg_last_error() function with more than expected no. of arguments --\n";
|
||||
$extra_arg = 10;
|
||||
var_dump( preg_last_error($extra_arg) );
|
||||
?>
|
||||
===Done===
|
||||
--EXPECTF--
|
||||
*** Testing preg_last_error() : error conditions ***
|
||||
|
||||
-- Testing preg_last_error() function with more than expected no. of arguments --
|
||||
|
||||
Warning: preg_last_error() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
===Done===
|
@ -1,44 +0,0 @@
|
||||
--TEST--
|
||||
Test preg_match_all() function : error conditions - incorrect number of parameters
|
||||
--FILE--
|
||||
<?php
|
||||
/*
|
||||
* proto int preg_match_all(string pattern, string subject, array subpatterns [, int flags [, int offset]])
|
||||
* Function is implemented in ext/pcre/php_pcre.c
|
||||
*/
|
||||
echo "*** Testing preg_match_all() : error conditions ***\n";
|
||||
// Zero arguments
|
||||
echo "\n-- Testing preg_match_all() function with Zero arguments --\n";
|
||||
var_dump(preg_match_all());
|
||||
//Test preg_match_all with one more than the expected number of arguments
|
||||
echo "\n-- Testing preg_match_all() function with more than expected no. of arguments --\n";
|
||||
$pattern = '/\w/';
|
||||
$subject = 'string_val';
|
||||
$flags = PREG_OFFSET_CAPTURE;
|
||||
$offset = 10;
|
||||
$extra_arg = 10;
|
||||
var_dump(preg_match_all($pattern, $subject, $matches, $flags, $offset, $extra_arg));
|
||||
// Testing preg_match_all withone less than the expected number of arguments
|
||||
echo "\n-- Testing preg_match_all() function with less than expected no. of arguments --\n";
|
||||
$pattern = '/\w/';
|
||||
var_dump(preg_match_all($pattern));
|
||||
echo "Done"
|
||||
?>
|
||||
--EXPECTF--
|
||||
*** Testing preg_match_all() : error conditions ***
|
||||
|
||||
-- Testing preg_match_all() function with Zero arguments --
|
||||
|
||||
Warning: preg_match_all() expects at least 2 parameters, 0 given in %spreg_match_all_error.php on line %d
|
||||
bool(false)
|
||||
|
||||
-- Testing preg_match_all() function with more than expected no. of arguments --
|
||||
|
||||
Warning: preg_match_all() expects at most 5 parameters, 6 given in %spreg_match_all_error.php on line %d
|
||||
bool(false)
|
||||
|
||||
-- Testing preg_match_all() function with less than expected no. of arguments --
|
||||
|
||||
Warning: preg_match_all() expects at least 2 parameters, 1 given in %spreg_match_all_error.php on line %d
|
||||
bool(false)
|
||||
Done
|
@ -1,44 +0,0 @@
|
||||
--TEST--
|
||||
Test preg_match() function : error conditions - wrong numbers of parameters
|
||||
--FILE--
|
||||
<?php
|
||||
/*
|
||||
* proto int preg_match(string pattern, string subject [, array subpatterns [, int flags [, int offset]]])
|
||||
* Function is implemented in ext/pcre/php_pcre.c
|
||||
*/
|
||||
echo "*** Testing preg_match() : error conditions ***\n";
|
||||
// Zero arguments
|
||||
echo "\n-- Testing preg_match() function with Zero arguments --\n";
|
||||
var_dump(preg_match());
|
||||
//Test preg_match with one more than the expected number of arguments
|
||||
echo "\n-- Testing preg_match() function with more than expected no. of arguments --\n";
|
||||
$pattern = '/\w/';
|
||||
$subject = 'string_val';
|
||||
$flags = PREG_OFFSET_CAPTURE;
|
||||
$offset = 10;
|
||||
$extra_arg = 10;
|
||||
var_dump(preg_match($pattern, $subject, $matches, $flags, $offset, $extra_arg));
|
||||
// Testing preg_match withone less than the expected number of arguments
|
||||
echo "\n-- Testing preg_match() function with less than expected no. of arguments --\n";
|
||||
$pattern = '/\w/';
|
||||
var_dump(preg_match($pattern));
|
||||
echo "Done"
|
||||
?>
|
||||
--EXPECTF--
|
||||
*** Testing preg_match() : error conditions ***
|
||||
|
||||
-- Testing preg_match() function with Zero arguments --
|
||||
|
||||
Warning: preg_match() expects at least 2 parameters, 0 given in %spreg_match_error.php on line %d
|
||||
bool(false)
|
||||
|
||||
-- Testing preg_match() function with more than expected no. of arguments --
|
||||
|
||||
Warning: preg_match() expects at most 5 parameters, 6 given in %spreg_match_error.php on line %d
|
||||
bool(false)
|
||||
|
||||
-- Testing preg_match() function with less than expected no. of arguments --
|
||||
|
||||
Warning: preg_match() expects at least 2 parameters, 1 given in %spreg_match_error.php on line %d
|
||||
bool(false)
|
||||
Done
|
@ -1,33 +0,0 @@
|
||||
--TEST--
|
||||
Test preg_quote() function : error conditions - wrong numbers of parameters
|
||||
--FILE--
|
||||
<?php
|
||||
/*
|
||||
* proto string preg_quote(string str [, string delim_char])
|
||||
* Function is implemented in ext/pcre/php_pcre.c
|
||||
*/
|
||||
echo "*** Testing preg_quote() : error conditions ***\n";
|
||||
// Zero arguments
|
||||
echo "\n-- Testing preg_quote() function with Zero arguments --\n";
|
||||
var_dump(preg_quote());
|
||||
//Test preg_quote with one more than the expected number of arguments
|
||||
echo "\n-- Testing preg_quote() function with more than expected no. of arguments --\n";
|
||||
$str = 'string_val';
|
||||
$delim_char = '/';
|
||||
$extra_arg = 10;
|
||||
var_dump(preg_quote($str, $delim_char, $extra_arg));
|
||||
echo "Done"
|
||||
?>
|
||||
--EXPECTF--
|
||||
*** Testing preg_quote() : error conditions ***
|
||||
|
||||
-- Testing preg_quote() function with Zero arguments --
|
||||
|
||||
Warning: preg_quote() expects at least 1 parameter, 0 given in %spreg_quote_error.php on line %d
|
||||
NULL
|
||||
|
||||
-- Testing preg_quote() function with more than expected no. of arguments --
|
||||
|
||||
Warning: preg_quote() expects at most 2 parameters, 3 given in %spreg_quote_error.php on line %d
|
||||
NULL
|
||||
Done
|
@ -1,36 +0,0 @@
|
||||
--TEST--
|
||||
Test preg_quote() function : error conditions - wrong arg types
|
||||
--FILE--
|
||||
<?php
|
||||
/*
|
||||
* proto string preg_quote(string str [, string delim_char])
|
||||
* Function is implemented in ext/pcre/php_pcre.c
|
||||
*/
|
||||
error_reporting(E_ALL&~E_NOTICE);
|
||||
/*
|
||||
* Testing how preg_quote reacts to being passed the wrong type of input argument
|
||||
*/
|
||||
echo "*** Testing preg_quote() : error conditions ***\n";
|
||||
$input = array('this is a string', array('this is', 'a subarray'),);
|
||||
foreach($input as $value) {
|
||||
print "\nArg value is: $value\n";
|
||||
var_dump(preg_quote($value));
|
||||
}
|
||||
$value = new stdclass(); //Object
|
||||
var_dump(preg_quote($value));
|
||||
echo "Done";
|
||||
?>
|
||||
--EXPECTF--
|
||||
*** Testing preg_quote() : error conditions ***
|
||||
|
||||
Arg value is: this is a string
|
||||
string(16) "this is a string"
|
||||
|
||||
Arg value is: Array
|
||||
|
||||
Warning: preg_quote() expects parameter 1 to be string, array given in %spreg_quote_error1.php on line %d
|
||||
NULL
|
||||
|
||||
Warning: preg_quote() expects parameter 1 to be string, object given in %spreg_quote_error1.php on line %d
|
||||
NULL
|
||||
Done
|
@ -1,48 +0,0 @@
|
||||
--TEST--
|
||||
Test preg_replace_callback() function : error
|
||||
--FILE--
|
||||
<?php
|
||||
/*
|
||||
* proto string preg_replace(mixed regex, mixed replace, mixed subject [, int limit [, count]])
|
||||
* Function is implemented in ext/pcre/php_pcre.c
|
||||
*/
|
||||
echo "***Testing preg_replace_callback() : error conditions***\n";
|
||||
//Zero arguments
|
||||
echo "\n-- Testing preg_replace_callback() function with Zero arguments --\n";
|
||||
var_dump(preg_replace_callback());
|
||||
//Test preg_replace_callback() with one more than the expected number of arguments
|
||||
echo "\n-- Testing preg_replace_callback() function with more than expected no. of arguments --\n";
|
||||
$replacement = array('zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine');
|
||||
function integer_word($matches) {
|
||||
global $replacement;
|
||||
return $replacement[$matches[0]];
|
||||
}
|
||||
$regex = '/\d/';
|
||||
$subject = 'there are 7 words in this sentence.';
|
||||
$limit = 10;
|
||||
$extra_arg = 10;
|
||||
var_dump(preg_replace_callback($regex, 'integer_word', $subject, $limit, $count, $extra_arg));
|
||||
//Testing preg_replace_callback() with one less than the expected number of arguments
|
||||
echo "\n-- Testing preg_replace_callback() function with less than expected no. of arguments --\n";
|
||||
$regex = '/\d/';
|
||||
var_dump(preg_replace_callback($regex, 'integer word'));
|
||||
echo "Done";
|
||||
?>
|
||||
--EXPECTF--
|
||||
***Testing preg_replace_callback() : error conditions***
|
||||
|
||||
-- Testing preg_replace_callback() function with Zero arguments --
|
||||
|
||||
Warning: preg_replace_callback() expects at least 3 parameters, 0 given in %s on line %d
|
||||
NULL
|
||||
|
||||
-- Testing preg_replace_callback() function with more than expected no. of arguments --
|
||||
|
||||
Warning: preg_replace_callback() expects at most 5 parameters, 6 given in %s on line %d
|
||||
NULL
|
||||
|
||||
-- Testing preg_replace_callback() function with less than expected no. of arguments --
|
||||
|
||||
Warning: preg_replace_callback() expects at least 3 parameters, 2 given in %s on line %d
|
||||
NULL
|
||||
Done
|
@ -1,45 +0,0 @@
|
||||
--TEST--
|
||||
Test preg_replace() function : error - incorrect number of parameters
|
||||
--FILE--
|
||||
<?php
|
||||
/*
|
||||
* proto string preg_replace(mixed regex, mixed replace, mixed subject [, int limit [, count]])
|
||||
* Function is implemented in ext/pcre/php_pcre.c
|
||||
*/
|
||||
echo "*** Testing preg_replace() : error conditions ***\n";
|
||||
//Zero arguments
|
||||
echo "\n-- Testing preg_replace() function with zero arguments --\n";
|
||||
var_dump(preg_replace());
|
||||
//Test preg_replace() with one more than the expected number of arguments
|
||||
echo "\n-- Testing preg_replace() function with more than expected no. of arguments --\n";
|
||||
$regex = '/\w/';
|
||||
$replace = '1';
|
||||
$subject = 'string_val';
|
||||
$limit = 10;
|
||||
$extra_arg = 10;
|
||||
var_dump(preg_replace($regex, $replace, $subject, $limit, $count, $extra_arg));
|
||||
//Testing preg_replace() with one less than the expected number of arguments
|
||||
echo "\n-- Testing preg_replace() function with less than expected no. of arguments --\n";
|
||||
$regex = '/\w/';
|
||||
$replace = '1';
|
||||
var_dump(preg_replace($regex, $replace));
|
||||
echo "Done"
|
||||
?>
|
||||
--EXPECTF--
|
||||
*** Testing preg_replace() : error conditions ***
|
||||
|
||||
-- Testing preg_replace() function with zero arguments --
|
||||
|
||||
Warning: preg_replace() expects at least 3 parameters, 0 given in %s on line %d
|
||||
NULL
|
||||
|
||||
-- Testing preg_replace() function with more than expected no. of arguments --
|
||||
|
||||
Warning: preg_replace() expects at most 5 parameters, 6 given in %s on line %d
|
||||
NULL
|
||||
|
||||
-- Testing preg_replace() function with less than expected no. of arguments --
|
||||
|
||||
Warning: preg_replace() expects at least 3 parameters, 2 given in %s on line %d
|
||||
NULL
|
||||
Done
|
@ -1,44 +0,0 @@
|
||||
--TEST--
|
||||
Test preg_split() function : error conditions - incorrect number of parameters
|
||||
--FILE--
|
||||
<?php
|
||||
/*
|
||||
* proto array preg_split(string pattern, string subject [, int limit [, int flags]])
|
||||
* Function is implemented in ext/pcre/php_pcre.c
|
||||
*/
|
||||
echo "*** Testing preg_split() : error conditions ***\n";
|
||||
// Zero arguments
|
||||
echo "\n-- Testing preg_split() function with Zero arguments --\n";
|
||||
var_dump(preg_split());
|
||||
//Test preg_split with one more than the expected number of arguments
|
||||
echo "\n-- Testing preg_split() function with more than expected no. of arguments --\n";
|
||||
$pattern = '/_/';
|
||||
$subject = 'string_val';
|
||||
$limit = 10;
|
||||
$flags = PREG_SPLIT_NO_EMPTY;
|
||||
$extra_arg = 10;
|
||||
var_dump(preg_split($pattern, $subject, $limit, $flags, $extra_arg));
|
||||
// Testing preg_split withone less than the expected number of arguments
|
||||
echo "\n-- Testing preg_split() function with less than expected no. of arguments --\n";
|
||||
$pattern = '/\./';
|
||||
var_dump(preg_split($pattern));
|
||||
echo "Done"
|
||||
?>
|
||||
--EXPECTF--
|
||||
*** Testing preg_split() : error conditions ***
|
||||
|
||||
-- Testing preg_split() function with Zero arguments --
|
||||
|
||||
Warning: preg_split() expects at least 2 parameters, 0 given in %spreg_split_error.php on line %d
|
||||
bool(false)
|
||||
|
||||
-- Testing preg_split() function with more than expected no. of arguments --
|
||||
|
||||
Warning: preg_split() expects at most 4 parameters, 5 given in %spreg_split_error.php on line %d
|
||||
bool(false)
|
||||
|
||||
-- Testing preg_split() function with less than expected no. of arguments --
|
||||
|
||||
Warning: preg_split() expects at least 2 parameters, 1 given in %spreg_split_error.php on line %d
|
||||
bool(false)
|
||||
Done
|
@ -1,34 +0,0 @@
|
||||
--TEST--
|
||||
Test preg_split() function : error conditions - wrong arg types
|
||||
--FILE--
|
||||
<?php
|
||||
/*
|
||||
* proto array preg_split(string pattern, string subject [, int limit [, int flags]])
|
||||
* Function is implemented in ext/pcre/php_pcre.c
|
||||
*/
|
||||
error_reporting(E_ALL&~E_NOTICE);
|
||||
/*
|
||||
* Testing how preg_split reacts to being passed the wrong type of input argument
|
||||
*/
|
||||
echo "*** Testing preg_split() : error conditions ***\n";
|
||||
$regex = '/[a-zA-Z]/';
|
||||
$input = array(array('this is', 'a subarray'),);
|
||||
foreach($input as $value) {
|
||||
print "\nArg value is: $value\n";
|
||||
var_dump(preg_split($regex, $value));
|
||||
}
|
||||
$value = new stdclass(); //Object
|
||||
var_dump(preg_split($regex, $value));
|
||||
echo "Done";
|
||||
?>
|
||||
--EXPECTF--
|
||||
*** Testing preg_split() : error conditions ***
|
||||
|
||||
Arg value is: Array
|
||||
|
||||
Warning: preg_split() expects parameter 2 to be string, array given in %spreg_split_error2.php on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: preg_split() expects parameter 2 to be string, object given in %spreg_split_error2.php on line %d
|
||||
bool(false)
|
||||
Done
|
@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
Test function posix_ctermid() by calling it more than or less than its expected arguments
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(!extension_loaded("posix")) print "skip - POSIX extension not loaded";
|
||||
?>
|
||||
--CREDITS--
|
||||
Marco Fabbri mrfabbri@gmail.com
|
||||
Francesco Fullone ff@ideato.it
|
||||
#PHPTestFest Cesena Italia on 2009-06-20
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump( posix_ctermid( 'foo' ) );
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: posix_ctermid() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
@ -1,31 +0,0 @@
|
||||
--TEST--
|
||||
Test posix_get_last_error() function : error conditions
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(!extension_loaded("posix")) print "skip - POSIX extension not loaded";
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
/* Prototype : proto int posix_get_last_error(void)
|
||||
* Description: Retrieve the error number set by the last posix function which failed.
|
||||
* Source code: ext/posix/posix.c
|
||||
* Alias to functions: posix_errno
|
||||
*/
|
||||
|
||||
echo "*** Testing posix_get_last_error() : error conditions ***\n";
|
||||
|
||||
// One argument
|
||||
echo "\n-- Testing posix_get_last_error() function with one argument --\n";
|
||||
$extra_arg = 10;
|
||||
var_dump( posix_get_last_error($extra_arg) );
|
||||
|
||||
echo "Done";
|
||||
?>
|
||||
--EXPECTF--
|
||||
*** Testing posix_get_last_error() : error conditions ***
|
||||
|
||||
-- Testing posix_get_last_error() function with one argument --
|
||||
|
||||
Warning: posix_get_last_error() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
Done
|
@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
posix_getcwd(): Basic tests
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('posix')) die('skip - POSIX extension not loaded');
|
||||
if (!function_exists('posix_getcwd')) die('skip posix_getcwd() not found');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
echo "Basic test of POSIX posix_getcwd function\n";
|
||||
var_dump(posix_getcwd());
|
||||
var_dump(posix_getcwd(1));
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
Basic test of POSIX posix_getcwd function
|
||||
string(%d) "%s"
|
||||
|
||||
Warning: posix_getcwd() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
===DONE===
|
@ -1,37 +0,0 @@
|
||||
--TEST--
|
||||
Test function posix_geteuid() by calling it more than or less than its expected arguments
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(!extension_loaded("posix")) print "skip - POSIX extension not loaded";
|
||||
?>
|
||||
--CREDITS--
|
||||
Marco Fabbri mrfabbri@gmail.com
|
||||
Francesco Fullone ff@ideato.it
|
||||
#PHPTestFest Cesena Italia on 2009-06-20
|
||||
--FILE--
|
||||
<?php
|
||||
echo "*** Test by calling method or function with incorrect numbers of arguments ***\n";
|
||||
|
||||
$extra_args = array( 12312, 2 => '1234', 'string' => 'string' );
|
||||
|
||||
var_dump( posix_geteuid( $extra_args ));
|
||||
foreach ( $extra_args as $arg )
|
||||
{
|
||||
var_dump(posix_geteuid( $arg ));
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
*** Test by calling method or function with incorrect numbers of arguments ***
|
||||
|
||||
Warning: posix_geteuid() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: posix_geteuid() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: posix_geteuid() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: posix_geteuid() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
@ -1,31 +0,0 @@
|
||||
--TEST--
|
||||
Test posix_getgid() function : error conditions
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(!extension_loaded("posix")) print "skip - POSIX extension not loaded";
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
/* Prototype : proto int posix_getgid(void)
|
||||
* Description: Get the current group id (POSIX.1, 4.2.1)
|
||||
* Source code: ext/posix/posix.c
|
||||
* Alias to functions:
|
||||
*/
|
||||
|
||||
echo "*** Testing posix_getgid() : error conditions ***\n";
|
||||
|
||||
// One argument
|
||||
echo "\n-- Testing posix_getgid() function with one argument --\n";
|
||||
$extra_arg = 10;
|
||||
var_dump( posix_getgid($extra_arg) );
|
||||
|
||||
echo "Done";
|
||||
?>
|
||||
--EXPECTF--
|
||||
*** Testing posix_getgid() : error conditions ***
|
||||
|
||||
-- Testing posix_getgid() function with one argument --
|
||||
|
||||
Warning: posix_getgid() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
Done
|
@ -1,28 +0,0 @@
|
||||
--TEST--
|
||||
Test parameters on posix_getgrgid().
|
||||
--CREDITS--
|
||||
Till Klampaeckel, till@php.net
|
||||
TestFest Berlin 2009
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('posix')) {
|
||||
die('SKIP The posix extension is not loaded.');
|
||||
}
|
||||
if (strtolower(PHP_OS) == 'darwin') {
|
||||
die('SKIP This test doesn\'t run on MacOSX/Darwin.');
|
||||
}
|
||||
--FILE--
|
||||
<?php
|
||||
$gid = PHP_INT_MAX; // obscene high gid
|
||||
var_dump(posix_getgrgid($gid));
|
||||
var_dump(posix_getgrgid(-1));
|
||||
var_dump(posix_getgrgid());
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
bool(false)
|
||||
bool(false)
|
||||
|
||||
Warning: posix_getgrgid() expects exactly 1 parameter, 0 given in %s on line %d
|
||||
bool(false)
|
||||
===DONE===
|
@ -1,31 +0,0 @@
|
||||
--TEST--
|
||||
Test posix_getpgrp() function : error conditions
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(!extension_loaded("posix")) print "skip - POSIX extension not loaded";
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
/* Prototype : proto int posix_getpgrp(void)
|
||||
* Description: Get current process group id (POSIX.1, 4.3.1)
|
||||
* Source code: ext/posix/posix.c
|
||||
* Alias to functions:
|
||||
*/
|
||||
|
||||
echo "*** Testing posix_getpgrp() : error conditions ***\n";
|
||||
|
||||
// One argument
|
||||
echo "\n-- Testing posix_getpgrp() function with one argument --\n";
|
||||
$extra_arg = 10;
|
||||
var_dump( posix_getpgrp($extra_arg) );
|
||||
|
||||
echo "Done";
|
||||
?>
|
||||
--EXPECTF--
|
||||
*** Testing posix_getpgrp() : error conditions ***
|
||||
|
||||
-- Testing posix_getpgrp() function with one argument --
|
||||
|
||||
Warning: posix_getpgrp() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
Done
|
@ -1,31 +0,0 @@
|
||||
--TEST--
|
||||
Test posix_getpid() function : error conditions
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(!extension_loaded("posix")) print "skip - POSIX extension not loaded";
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
/* Prototype : proto int posix_getpid(void)
|
||||
* Description: Get the current process id (POSIX.1, 4.1.1)
|
||||
* Source code: ext/posix/posix.c
|
||||
* Alias to functions:
|
||||
*/
|
||||
|
||||
echo "*** Testing posix_getpid() : error conditions ***\n";
|
||||
|
||||
// One argument
|
||||
echo "\n-- Testing posix_getpid() function with one argument --\n";
|
||||
$extra_arg = 10;
|
||||
var_dump( posix_getpid($extra_arg) );
|
||||
|
||||
echo "Done";
|
||||
?>
|
||||
--EXPECTF--
|
||||
*** Testing posix_getpid() : error conditions ***
|
||||
|
||||
-- Testing posix_getpid() function with one argument --
|
||||
|
||||
Warning: posix_getpid() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
Done
|
@ -1,31 +0,0 @@
|
||||
--TEST--
|
||||
Test posix_getppid() function : error conditions
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(!extension_loaded("posix")) print "skip - POSIX extension not loaded";
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
/* Prototype : proto int posix_getppid(void)
|
||||
* Description: Get the parent process id (POSIX.1, 4.1.1)
|
||||
* Source code: ext/posix/posix.c
|
||||
* Alias to functions:
|
||||
*/
|
||||
|
||||
echo "*** Testing posix_getppid() : error conditions ***\n";
|
||||
|
||||
// One argument
|
||||
echo "\n-- Testing posix_getppid() function with one argument --\n";
|
||||
$extra_arg = 10;
|
||||
var_dump( posix_getppid($extra_arg) );
|
||||
|
||||
echo "Done";
|
||||
?>
|
||||
--EXPECTF--
|
||||
*** Testing posix_getppid() : error conditions ***
|
||||
|
||||
-- Testing posix_getppid() function with one argument --
|
||||
|
||||
Warning: posix_getppid() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
Done
|
@ -1,31 +0,0 @@
|
||||
--TEST--
|
||||
Test posix_getuid() function : error conditions
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(!extension_loaded("posix")) print "skip - POSIX extension not loaded";
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
/* Prototype : proto int posix_getuid(void)
|
||||
* Description: Get the current user id (POSIX.1, 4.2.1)
|
||||
* Source code: ext/posix/posix.c
|
||||
* Alias to functions:
|
||||
*/
|
||||
|
||||
echo "*** Testing posix_getuid() : error conditions ***\n";
|
||||
|
||||
// One argument
|
||||
echo "\n-- Testing posix_getuid() function with one argument --\n";
|
||||
$extra_arg = 10;
|
||||
var_dump( posix_getuid($extra_arg) );
|
||||
|
||||
echo "Done";
|
||||
?>
|
||||
--EXPECTF--
|
||||
*** Testing posix_getuid() : error conditions ***
|
||||
|
||||
-- Testing posix_getuid() function with one argument --
|
||||
|
||||
Warning: posix_getuid() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
Done
|
@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
posix_initgroups(): Basic tests
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('posix')) die('skip - POSIX extension not loaded');
|
||||
if (!function_exists('posix_initgroups')) die('skip posix_initgroups() not found');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
echo "Basic test of POSIX posix_initgroups function\n";
|
||||
var_dump(posix_initgroups('foo', 'bar'));
|
||||
var_dump(posix_initgroups(NULL, NULL));
|
||||
|
||||
?>
|
||||
===DONE====
|
||||
--EXPECTF--
|
||||
Basic test of POSIX posix_initgroups function
|
||||
|
||||
Warning: posix_initgroups() expects parameter 2 to be int, string given in %s on line %d
|
||||
bool(false)
|
||||
bool(false)
|
||||
===DONE====
|
@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
Test parameter validation in posix_mkfifo().
|
||||
--CREDITS--
|
||||
Till Klampaeckel, till@php.net
|
||||
TestFest Berlin 2009
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('posix')) {
|
||||
die('SKIP The posix extension is not loaded.');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
posix_mkfifo(null);
|
||||
var_dump(posix_mkfifo(null, 0644));
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
Warning: posix_mkfifo() expects exactly 2 parameters, 1 given in %s on line %d
|
||||
bool(false)
|
||||
===DONE===
|
@ -1,32 +0,0 @@
|
||||
--TEST--
|
||||
Test function posix_seteuid() by calling it more than or less than its expected arguments
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(!extension_loaded("posix")) print "skip - POSIX extension not loaded";
|
||||
?>
|
||||
--CREDITS--
|
||||
Marco Fabbri mrfabbri@gmail.com
|
||||
Francesco Fullone ff@ideato.it
|
||||
#PHPTestFest Cesena Italia on 2009-06-20
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
echo "*** Test by calling method or function with incorrect numbers of arguments ***\n";
|
||||
|
||||
$uid = '123';
|
||||
$extra_arg = '12312';
|
||||
|
||||
var_dump(posix_seteuid( $uid, $extra_arg ) );
|
||||
var_dump(posix_seteuid( ) );
|
||||
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
*** Test by calling method or function with incorrect numbers of arguments ***
|
||||
|
||||
Warning: posix_seteuid() expects exactly 1 parameter, 2 given in %s on line 9
|
||||
bool(false)
|
||||
|
||||
Warning: posix_seteuid() expects exactly 1 parameter, 0 given in %s on line 10
|
||||
bool(false)
|
@ -1,41 +0,0 @@
|
||||
--TEST--
|
||||
Test function posix_seteuid() by substituting argument 1 with array values.
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(!extension_loaded("posix")) print "skip - POSIX extension not loaded";
|
||||
?>
|
||||
--CREDITS--
|
||||
Marco Fabbri mrfabbri@gmail.com
|
||||
Francesco Fullone ff@ideato.it
|
||||
#PHPTestFest Cesena Italia on 2009-06-20
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$index_array = array(1, 2, 3);
|
||||
$assoc_array = array(1 => '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(posix_seteuid( $var ) );
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: posix_seteuid() expects parameter 1 to be int, array given in %s on line 15
|
||||
bool(false)
|
||||
|
||||
Warning: posix_seteuid() expects parameter 1 to be int, array given in %s on line 15
|
||||
bool(false)
|
||||
|
||||
Warning: posix_seteuid() expects parameter 1 to be int, array given in %s on line 15
|
||||
bool(false)
|
||||
|
||||
Warning: posix_seteuid() expects parameter 1 to be int, array given in %s on line 15
|
||||
bool(false)
|
@ -1,48 +0,0 @@
|
||||
--TEST--
|
||||
Test function posix_seteuid() by substituting argument 1 with string values.
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(!extension_loaded("posix")) print "skip - POSIX extension not loaded";
|
||||
?>
|
||||
--CREDITS--
|
||||
Marco Fabbri mrfabbri@gmail.com
|
||||
Francesco Fullone ff@ideato.it
|
||||
#PHPTestFest Cesena Italia on 2009-06-20
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
echo "*** Test substituting argument 1 with string values ***\n";
|
||||
|
||||
|
||||
|
||||
$heredoc = <<<EOT
|
||||
hello world
|
||||
EOT;
|
||||
|
||||
$variation_array = array(
|
||||
'string DQ' => "string",
|
||||
'string SQ' => 'string',
|
||||
'mixed case string' => "sTrInG",
|
||||
'heredoc' => $heredoc,
|
||||
);
|
||||
|
||||
|
||||
foreach ( $variation_array as $var ) {
|
||||
var_dump(posix_seteuid( $var ) );
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
*** Test substituting argument 1 with string values ***
|
||||
|
||||
Warning: posix_seteuid() expects parameter 1 to be int, string given in %s on line 21
|
||||
bool(false)
|
||||
|
||||
Warning: posix_seteuid() expects parameter 1 to be int, string given in %s on line 21
|
||||
bool(false)
|
||||
|
||||
Warning: posix_seteuid() expects parameter 1 to be int, string given in %s on line 21
|
||||
bool(false)
|
||||
|
||||
Warning: posix_seteuid() expects parameter 1 to be int, string given in %s on line 21
|
||||
bool(false)
|
@ -1,32 +0,0 @@
|
||||
--TEST--
|
||||
Test function posix_setgid() by calling it more than or less than its expected arguments.
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(!extension_loaded("posix")) print "skip - POSIX extension not loaded";
|
||||
?>
|
||||
Marco Fabbri mrfabbri@gmail.com
|
||||
Francesco Fullone ff@ideato.it
|
||||
#PHPTestFest Cesena Italia on 2009-06-20
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
echo "*** Test by calling method or function with incorrect numbers of arguments ***\n";
|
||||
|
||||
$gid = posix_getgid();
|
||||
$extra_arg = '123';
|
||||
|
||||
var_dump(posix_setgid( $gid, $extra_arg ) );
|
||||
var_dump(posix_setgid( ) );
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
*** Test by calling method or function with incorrect numbers of arguments ***
|
||||
|
||||
Warning: posix_setgid() expects exactly 1 parameter, 2 given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: posix_setgid() expects exactly 1 parameter, 0 given in %s on line %d
|
||||
bool(false)
|
||||
===DONE===
|
@ -1,47 +0,0 @@
|
||||
--TEST--
|
||||
Test function posix_setgid() by substituting argument 1 with array values.
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(!extension_loaded("posix")) print "skip - POSIX extension not loaded";
|
||||
?>
|
||||
--CREDITS--
|
||||
Marco Fabbri mrfabbri@gmail.com
|
||||
Francesco Fullone ff@ideato.it
|
||||
#PHPTestFest Cesena Italia on 2009-06-20
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
echo "*** Test substituting argument 1 with array values ***\n";
|
||||
|
||||
$index_array = array(1, 2, 3);
|
||||
$assoc_array = array(1 => '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(posix_setgid( $var ) );
|
||||
}
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
*** Test substituting argument 1 with array values ***
|
||||
|
||||
Warning: posix_setgid() expects parameter 1 to be int, array given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: posix_setgid() expects parameter 1 to be int, array given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: posix_setgid() expects parameter 1 to be int, array given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: posix_setgid() expects parameter 1 to be int, array given in %s on line %d
|
||||
bool(false)
|
||||
===DONE===
|
@ -1,48 +0,0 @@
|
||||
--TEST--
|
||||
Test function posix_setgid() by substituting argument 1 with string values.
|
||||
--CREDITS--
|
||||
Marco Fabbri mrfabbri@gmail.com
|
||||
Francesco Fullone ff@ideato.it
|
||||
#PHPTestFest Cesena Italia on 2009-06-20
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(!extension_loaded("posix")) print "skip - POSIX extension not loaded";
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
echo "*** Test substituting argument 1 with string values ***\n";
|
||||
|
||||
|
||||
|
||||
$heredoc = <<<EOT
|
||||
hello world
|
||||
EOT;
|
||||
|
||||
$variation_array = array(
|
||||
'string DQ' => "string",
|
||||
'string SQ' => 'string',
|
||||
'mixed case string' => "sTrInG",
|
||||
'heredoc' => $heredoc,
|
||||
);
|
||||
|
||||
|
||||
foreach ( $variation_array as $var ) {
|
||||
var_dump(posix_setgid( $var ) );
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
*** Test substituting argument 1 with string values ***
|
||||
|
||||
Warning: posix_setgid() expects parameter 1 to be int, string given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: posix_setgid() expects parameter 1 to be int, string given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: posix_setgid() expects parameter 1 to be int, string given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: posix_setgid() expects parameter 1 to be int, string given in %s on line %d
|
||||
bool(false)
|
@ -1,35 +0,0 @@
|
||||
--TEST--
|
||||
Test function posix_setuid() by calling it more than or less than its expected arguments
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(!extension_loaded("posix")) print "skip - POSIX extension not loaded";
|
||||
?>
|
||||
--CREDITS--
|
||||
Marco Fabbri mrfabbri@gmail.com
|
||||
Francesco Fullone ff@ideato.it
|
||||
#PHPTestFest Cesena Italia on 2009-06-20
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
echo "*** Test by calling method or function with incorrect numbers of arguments ***\n";
|
||||
|
||||
$uid = '123';
|
||||
|
||||
|
||||
$extra_arg = '12312';
|
||||
|
||||
var_dump(posix_setuid( $uid, $extra_arg ) );
|
||||
|
||||
var_dump(posix_setuid( ) );
|
||||
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
*** Test by calling method or function with incorrect numbers of arguments ***
|
||||
|
||||
Warning: posix_setuid() expects exactly 1 parameter, 2 given in %s on line 11
|
||||
bool(false)
|
||||
|
||||
Warning: posix_setuid() expects exactly 1 parameter, 0 given in %s on line 13
|
||||
bool(false)
|
@ -1,41 +0,0 @@
|
||||
--TEST--
|
||||
Test function posix_setuid() by substituting argument 1 with array values.
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(!extension_loaded("posix")) print "skip - POSIX extension not loaded";
|
||||
?>
|
||||
--CREDITS--
|
||||
Marco Fabbri mrfabbri@gmail.com
|
||||
Francesco Fullone ff@ideato.it
|
||||
#PHPTestFest Cesena Italia on 2009-06-20
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$index_array = array(1, 2, 3);
|
||||
$assoc_array = array(1 => '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(posix_setuid( $var ) );
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: posix_setuid() expects parameter 1 to be int, array given in %s on line 15
|
||||
bool(false)
|
||||
|
||||
Warning: posix_setuid() expects parameter 1 to be int, array given in %s on line 15
|
||||
bool(false)
|
||||
|
||||
Warning: posix_setuid() expects parameter 1 to be int, array given in %s on line 15
|
||||
bool(false)
|
||||
|
||||
Warning: posix_setuid() expects parameter 1 to be int, array given in %s on line 15
|
||||
bool(false)
|
@ -1,48 +0,0 @@
|
||||
--TEST--
|
||||
Test function posix_setuid() by substituting argument 1 with string values.
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(!extension_loaded("posix")) print "skip - POSIX extension not loaded";
|
||||
?>
|
||||
--CREDITS--
|
||||
Marco Fabbri mrfabbri@gmail.com
|
||||
Francesco Fullone ff@ideato.it
|
||||
#PHPTestFest Cesena Italia on 2009-06-20
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
echo "*** Test substituting argument 1 with string values ***\n";
|
||||
|
||||
|
||||
|
||||
$heredoc = <<<EOT
|
||||
hello world
|
||||
EOT;
|
||||
|
||||
$variation_array = array(
|
||||
'string DQ' => "string",
|
||||
'string SQ' => 'string',
|
||||
'mixed case string' => "sTrInG",
|
||||
'heredoc' => $heredoc,
|
||||
);
|
||||
|
||||
|
||||
foreach ( $variation_array as $var ) {
|
||||
var_dump(posix_setuid( $var ) );
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
*** Test substituting argument 1 with string values ***
|
||||
|
||||
Warning: posix_setuid() expects parameter 1 to be int, string given in %s on line 21
|
||||
bool(false)
|
||||
|
||||
Warning: posix_setuid() expects parameter 1 to be int, string given in %s on line 21
|
||||
bool(false)
|
||||
|
||||
Warning: posix_setuid() expects parameter 1 to be int, string given in %s on line 21
|
||||
bool(false)
|
||||
|
||||
Warning: posix_setuid() expects parameter 1 to be int, string given in %s on line 21
|
||||
bool(false)
|
@ -1,31 +0,0 @@
|
||||
--TEST--
|
||||
Test posix_times() function : error conditions
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(!extension_loaded("posix")) print "skip - POSIX extension not loaded";
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
/* Prototype : proto array posix_times(void)
|
||||
* Description: Get process times (POSIX.1, 4.5.2)
|
||||
* Source code: ext/posix/posix.c
|
||||
* Alias to functions:
|
||||
*/
|
||||
|
||||
echo "*** Testing posix_times() : error conditions ***\n";
|
||||
|
||||
// One argument
|
||||
echo "\n-- Testing posix_times() function with one argument --\n";
|
||||
$extra_arg = 10;
|
||||
var_dump( posix_times($extra_arg) );
|
||||
|
||||
echo "Done";
|
||||
?>
|
||||
--EXPECTF--
|
||||
*** Testing posix_times() : error conditions ***
|
||||
|
||||
-- Testing posix_times() function with one argument --
|
||||
|
||||
Warning: posix_times() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
Done
|
@ -1,35 +0,0 @@
|
||||
--TEST--
|
||||
Test function posix_ttyname() by calling it more than or less than its expected arguments
|
||||
--CREDITS--
|
||||
Marco Fabbri mrfabbri@gmail.com
|
||||
Francesco Fullone ff@ideato.it
|
||||
#PHPTestFest Cesena Italia on 2009-06-20
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('posix')) {
|
||||
die('SKIP The posix extension is not loaded.');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
echo "*** Test by calling method or function with incorrect numbers of arguments ***\n";
|
||||
|
||||
$fd = 'foo';
|
||||
$extra_arg = 'bar';
|
||||
|
||||
var_dump(posix_ttyname( $fd, $extra_arg ) );
|
||||
|
||||
var_dump(posix_ttyname( ) );
|
||||
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
*** Test by calling method or function with incorrect numbers of arguments ***
|
||||
|
||||
Warning: posix_ttyname() expects exactly 1 parameter, 2 given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: posix_ttyname() expects exactly 1 parameter, 0 given in %s on line %d
|
||||
bool(false)
|
@ -1,31 +0,0 @@
|
||||
--TEST--
|
||||
Test posix_uname() function : error conditions
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(!extension_loaded("posix")) print "skip - POSIX extension not loaded";
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
/* Prototype : proto array posix_uname(void)
|
||||
* Description: Get system name (POSIX.1, 4.4.1)
|
||||
* Source code: ext/posix/posix.c
|
||||
* Alias to functions:
|
||||
*/
|
||||
|
||||
echo "*** Testing posix_uname() : error conditions ***\n";
|
||||
|
||||
// One argument
|
||||
echo "\n-- Testing posix_uname() function with one argument --\n";
|
||||
$extra_arg = 10;
|
||||
var_dump( posix_uname($extra_arg) );
|
||||
|
||||
echo "Done";
|
||||
?>
|
||||
--EXPECTF--
|
||||
*** Testing posix_uname() : error conditions ***
|
||||
|
||||
-- Testing posix_uname() function with one argument --
|
||||
|
||||
Warning: posix_uname() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
Done
|
@ -1,37 +0,0 @@
|
||||
--TEST--
|
||||
ReflectionClass::getFileName(), ReflectionClass::getStartLine(), ReflectionClass::getEndLine() - bad params
|
||||
--FILE--
|
||||
<?php
|
||||
Class C { }
|
||||
|
||||
$rc = new ReflectionClass("C");
|
||||
$methods = array("getFileName", "getStartLine", "getEndLine");
|
||||
|
||||
foreach ($methods as $method) {
|
||||
var_dump($rc->$method());
|
||||
var_dump($rc->$method(null));
|
||||
var_dump($rc->$method('X', 0));
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(%d) "%s"
|
||||
|
||||
Warning: ReflectionClass::getFileName() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::getFileName() expects exactly 0 parameters, 2 given in %s on line %d
|
||||
NULL
|
||||
int(2)
|
||||
|
||||
Warning: ReflectionClass::getStartLine() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::getStartLine() expects exactly 0 parameters, 2 given in %s on line %d
|
||||
NULL
|
||||
int(2)
|
||||
|
||||
Warning: ReflectionClass::getEndLine() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::getEndLine() expects exactly 0 parameters, 2 given in %s on line %d
|
||||
NULL
|
@ -1,23 +0,0 @@
|
||||
--TEST--
|
||||
ReflectionClass::getConstructor() - bad params
|
||||
--FILE--
|
||||
<?php
|
||||
class C {}
|
||||
$rc = new ReflectionClass('C');
|
||||
var_dump($rc->getConstructor(null));
|
||||
var_dump($rc->getConstructor('X'));
|
||||
var_dump($rc->getConstructor(true));
|
||||
var_dump($rc->getConstructor(array(1,2,3)));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: ReflectionClass::getConstructor() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::getConstructor() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::getConstructor() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::getConstructor() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
@ -1,44 +0,0 @@
|
||||
--TEST--
|
||||
ReflectionClass::getDefaultProperties(), ReflectionClass::getStaticProperties() - wrong param count
|
||||
--CREDITS--
|
||||
Robin Fernandes <robinf@php.net>
|
||||
Steve Seear <stevseea@php.net>
|
||||
--FILE--
|
||||
<?php
|
||||
interface I {}
|
||||
class C implements I {}
|
||||
$rc = new ReflectionClass('C');
|
||||
var_dump($rc->getDefaultProperties(null));
|
||||
var_dump($rc->getDefaultProperties('X'));
|
||||
var_dump($rc->getDefaultProperties(true));
|
||||
var_dump($rc->getDefaultProperties(array(1,2,3)));
|
||||
var_dump($rc->getStaticProperties(null));
|
||||
var_dump($rc->getStaticProperties('X'));
|
||||
var_dump($rc->getStaticProperties(true));
|
||||
var_dump($rc->getStaticProperties(array(1,2,3)));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: ReflectionClass::getDefaultProperties() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::getDefaultProperties() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::getDefaultProperties() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::getDefaultProperties() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::getStaticProperties() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::getStaticProperties() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::getStaticProperties() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::getStaticProperties() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
@ -1,26 +0,0 @@
|
||||
--TEST--
|
||||
ReflectionClass::getDocComment() - bad params
|
||||
--CREDITS--
|
||||
Robin Fernandes <robinf@php.net>
|
||||
Steve Seear <stevseea@php.net>
|
||||
--FILE--
|
||||
<?php
|
||||
class C {}
|
||||
$rc = new ReflectionClass('C');
|
||||
var_dump($rc->getDocComment(null));
|
||||
var_dump($rc->getDocComment('X'));
|
||||
var_dump($rc->getDocComment(true));
|
||||
var_dump($rc->getDocComment(array(1,2,3)));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: ReflectionClass::getDocComment() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::getDocComment() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::getDocComment() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::getDocComment() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
@ -1,27 +0,0 @@
|
||||
--TEST--
|
||||
ReflectionClass::getInterfaces() - wrong param count
|
||||
--CREDITS--
|
||||
Robin Fernandes <robinf@php.net>
|
||||
Steve Seear <stevseea@php.net>
|
||||
--FILE--
|
||||
<?php
|
||||
interface I {}
|
||||
class C implements I {}
|
||||
$rc = new ReflectionClass('C');
|
||||
var_dump($rc->getInterfaces(null));
|
||||
var_dump($rc->getInterfaces('X'));
|
||||
var_dump($rc->getInterfaces(true));
|
||||
var_dump($rc->getInterfaces(array(1,2,3)));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: ReflectionClass::getInterfaces() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::getInterfaces() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::getInterfaces() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::getInterfaces() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
ReflectionClass::getMethods() - invalid arguments
|
||||
--CREDITS--
|
||||
Robin Fernandes <robinf@php.net>
|
||||
Steve Seear <stevseea@php.net>
|
||||
--FILE--
|
||||
<?php
|
||||
$rc = new ReflectionClass("ReflectionClass");
|
||||
echo "\nTest invalid arguments:";
|
||||
$rc->getMethods('X');
|
||||
$rc->getMethods('X', true);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Test invalid arguments:
|
||||
Warning: ReflectionClass::getMethods() expects parameter 1 to be int, string given in %s on line 4
|
||||
|
||||
Warning: ReflectionClass::getMethods() expects at most 1 parameter, 2 given in %s on line 5
|
@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
ReflectionClass::getName() - invalid params
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$r1 = new ReflectionClass("stdClass");
|
||||
|
||||
var_dump($r1->getName('X'));
|
||||
var_dump($r1->getName('X', true));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: ReflectionClass::getName() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::getName() expects exactly 0 parameters, 2 given in %s on line %d
|
||||
NULL
|
@ -1,17 +0,0 @@
|
||||
--TEST--
|
||||
ReflectionClass::getProperties() - invalid arguments
|
||||
--CREDITS--
|
||||
Robin Fernandes <robinf@php.net>
|
||||
Steve Seear <stevseea@php.net>
|
||||
--FILE--
|
||||
<?php
|
||||
$rc = new ReflectionClass("ReflectionClass");
|
||||
echo "\nTest invalid arguments:";
|
||||
$rc->getProperties('X');
|
||||
$rc->getProperties('X', true);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Test invalid arguments:
|
||||
Warning: ReflectionClass::getProperties() expects parameter 1 to be int, string given in %s on line 4
|
||||
|
||||
Warning: ReflectionClass::getProperties() expects at most 1 parameter, 2 given in %s on line 5
|
@ -1,39 +0,0 @@
|
||||
--TEST--
|
||||
ReflectionClass::isInstance() - invalid params
|
||||
--FILE--
|
||||
<?php
|
||||
class X {}
|
||||
|
||||
$rc = new ReflectionClass("X");
|
||||
$instance = new X;
|
||||
|
||||
var_dump($rc->isInstance());
|
||||
var_dump($rc->isInstance($instance, $instance));
|
||||
var_dump($rc->isInstance(1));
|
||||
var_dump($rc->isInstance(1.5));
|
||||
var_dump($rc->isInstance(true));
|
||||
var_dump($rc->isInstance('X'));
|
||||
var_dump($rc->isInstance(null));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: ReflectionClass::isInstance() expects exactly 1 parameter, 0 given in %s on line 7
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::isInstance() expects exactly 1 parameter, 2 given in %s on line 8
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::isInstance() expects parameter 1 to be object, %s given in %s on line 9
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::isInstance() expects parameter 1 to be object, float given in %s on line 10
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::isInstance() expects parameter 1 to be object, bool given in %s on line 11
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::isInstance() expects parameter 1 to be object, string given in %s on line 12
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::isInstance() expects parameter 1 to be object, null given in %s on line 13
|
||||
NULL
|
@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
ReflectionClass::IsInstantiable()
|
||||
--FILE--
|
||||
<?php
|
||||
class privateCtorOld {
|
||||
private function privateCtorOld() {}
|
||||
}
|
||||
$reflectionClass = new ReflectionClass("privateCtorOld");
|
||||
|
||||
var_dump($reflectionClass->IsInstantiable('X'));
|
||||
var_dump($reflectionClass->IsInstantiable(0, null));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; privateCtorOld has a deprecated constructor in %s on line %d
|
||||
|
||||
Warning: ReflectionClass::isInstantiable() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::isInstantiable() expects exactly 0 parameters, 2 given in %s on line %d
|
||||
NULL
|
@ -1,14 +0,0 @@
|
||||
--TEST--
|
||||
ReflectionClass::isInternal() - invalid params
|
||||
--FILE--
|
||||
<?php
|
||||
$r1 = new ReflectionClass("stdClass");
|
||||
var_dump($r1->isInternal('X'));
|
||||
var_dump($r1->isInternal('X', true));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: ReflectionClass::isInternal() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::isInternal() expects exactly 0 parameters, 2 given in %s on line %d
|
||||
NULL
|
@ -1,17 +0,0 @@
|
||||
--TEST--
|
||||
ReflectionClass::isSubclassOf() - invalid number of parameters
|
||||
--FILE--
|
||||
<?php
|
||||
class A {}
|
||||
$rc = new ReflectionClass('A');
|
||||
|
||||
var_dump($rc->isSubclassOf());
|
||||
var_dump($rc->isSubclassOf('A',5));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: ReflectionClass::isSubclassOf() expects exactly 1 parameter, 0 given in %s on line 5
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::isSubclassOf() expects exactly 1 parameter, 2 given in %s on line 6
|
||||
NULL
|
@ -1,14 +0,0 @@
|
||||
--TEST--
|
||||
ReflectionClass::isUserDefined() - invalid params.
|
||||
--FILE--
|
||||
<?php
|
||||
$r1 = new ReflectionClass("stdClass");
|
||||
var_dump($r1->isUserDefined('X'));
|
||||
var_dump($r1->isUserDefined('X', true));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: ReflectionClass::isUserDefined() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::isUserDefined() expects exactly 0 parameters, 2 given in %s on line %d
|
||||
NULL
|
@ -1,27 +0,0 @@
|
||||
--TEST--
|
||||
Modifiers - wrong param count
|
||||
--CREDITS--
|
||||
Robin Fernandes <robinf@php.net>
|
||||
Steve Seear <stevseea@php.net>
|
||||
--FILE--
|
||||
<?php
|
||||
class C {}
|
||||
$rc = new ReflectionClass("C");
|
||||
var_dump($rc->isFinal('X'));
|
||||
var_dump($rc->isInterface(null));
|
||||
var_dump($rc->isAbstract(true));
|
||||
var_dump($rc->getModifiers(array(1,2,3)));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: ReflectionClass::isFinal() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::isInterface() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::isAbstract() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::getModifiers() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
@ -1,27 +0,0 @@
|
||||
--TEST--
|
||||
Test ReflectionFunction::getClosure() function : error functionality
|
||||
--FILE--
|
||||
<?php
|
||||
/* Prototype : public mixed ReflectionFunction::getClosure()
|
||||
* Description: Returns a dynamically created closure for the function
|
||||
* Source code: ext/reflection/php_reflection.c
|
||||
* Alias to functions:
|
||||
*/
|
||||
|
||||
echo "*** Testing ReflectionFunction::getClosure() : error conditions ***\n";
|
||||
|
||||
function foo()
|
||||
{
|
||||
var_dump( "Inside foo function" );
|
||||
}
|
||||
|
||||
$func = new ReflectionFunction( 'foo' );
|
||||
$closure = $func->getClosure('bar');
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
*** Testing ReflectionFunction::getClosure() : error conditions ***
|
||||
|
||||
Warning: ReflectionFunction::getClosure() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
===DONE===
|
@ -1,15 +0,0 @@
|
||||
--TEST--
|
||||
ReflectionMethod::getDocComment() errors
|
||||
--FILE--
|
||||
<?php
|
||||
class C { function f() {} }
|
||||
$rc = new ReflectionMethod('C::f');
|
||||
var_dump($rc->getDocComment(null));
|
||||
var_dump($rc->getDocComment('X'));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: ReflectionFunctionAbstract::getDocComment() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: ReflectionFunctionAbstract::getDocComment() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
@ -1,37 +0,0 @@
|
||||
--TEST--
|
||||
ReflectionObject::getFileName(), ReflectionObject::getStartLine(), ReflectionObject::getEndLine() -invalid aparams
|
||||
--FILE--
|
||||
<?php
|
||||
Class C { }
|
||||
|
||||
$rc = new ReflectionObject(new C);
|
||||
$methods = array("getFileName", "getStartLine", "getEndLine");
|
||||
|
||||
foreach ($methods as $method) {
|
||||
var_dump($rc->$method());
|
||||
var_dump($rc->$method(null));
|
||||
var_dump($rc->$method('X', 0));
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(%d) "%s"
|
||||
|
||||
Warning: ReflectionClass::getFileName() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::getFileName() expects exactly 0 parameters, 2 given in %s on line %d
|
||||
NULL
|
||||
int(2)
|
||||
|
||||
Warning: ReflectionClass::getStartLine() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::getStartLine() expects exactly 0 parameters, 2 given in %s on line %d
|
||||
NULL
|
||||
int(2)
|
||||
|
||||
Warning: ReflectionClass::getEndLine() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::getEndLine() expects exactly 0 parameters, 2 given in %s on line %d
|
||||
NULL
|
@ -1,17 +0,0 @@
|
||||
--TEST--
|
||||
ReflectionObject::getConstants() - invalid params
|
||||
--FILE--
|
||||
<?php
|
||||
class X {
|
||||
}
|
||||
|
||||
$rc = new ReflectionObject(new X);
|
||||
|
||||
$rc->getConstants('X');
|
||||
$rc->getConstants(true);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: ReflectionClass::getConstants() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
|
||||
Warning: ReflectionClass::getConstants() expects exactly 0 parameters, 1 given in %s on line %d
|
@ -1,23 +0,0 @@
|
||||
--TEST--
|
||||
ReflectionObject::getConstructor() - invalid params
|
||||
--FILE--
|
||||
<?php
|
||||
class C {}
|
||||
$rc = new ReflectionObject(new C);
|
||||
var_dump($rc->getConstructor(null));
|
||||
var_dump($rc->getConstructor('X'));
|
||||
var_dump($rc->getConstructor(true));
|
||||
var_dump($rc->getConstructor(array(1,2,3)));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: ReflectionClass::getConstructor() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::getConstructor() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::getConstructor() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::getConstructor() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
@ -1,23 +0,0 @@
|
||||
--TEST--
|
||||
ReflectionObject::getname() - invalid params
|
||||
--FILE--
|
||||
<?php
|
||||
class C { }
|
||||
$myInstance = new C;
|
||||
$r2 = new ReflectionObject($myInstance);
|
||||
|
||||
$r3 = new ReflectionObject($r2);
|
||||
|
||||
var_dump($r3->getName(null));
|
||||
var_dump($r3->getName('x','y'));
|
||||
var_dump($r3->getName(0));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: ReflectionClass::getName() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::getName() expects exactly 0 parameters, 2 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::getName() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
@ -1,38 +0,0 @@
|
||||
--TEST--
|
||||
ReflectionObject::isInstance() - invalid params
|
||||
--FILE--
|
||||
<?php
|
||||
class X {}
|
||||
$instance = new X;
|
||||
$ro = new ReflectionObject(new X);
|
||||
|
||||
var_dump($ro->isInstance());
|
||||
var_dump($ro->isInstance($instance, $instance));
|
||||
var_dump($ro->isInstance(1));
|
||||
var_dump($ro->isInstance(1.5));
|
||||
var_dump($ro->isInstance(true));
|
||||
var_dump($ro->isInstance('X'));
|
||||
var_dump($ro->isInstance(null));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: ReflectionClass::isInstance() expects exactly 1 parameter, 0 given in %s on line 6
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::isInstance() expects exactly 1 parameter, 2 given in %s on line 7
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::isInstance() expects parameter 1 to be object, int given in %s on line 8
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::isInstance() expects parameter 1 to be object, float given in %s on line 9
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::isInstance() expects parameter 1 to be object, bool given in %s on line 10
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::isInstance() expects parameter 1 to be object, string given in %s on line 11
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::isInstance() expects parameter 1 to be object, null given in %s on line 12
|
||||
NULL
|
@ -1,24 +0,0 @@
|
||||
--TEST--
|
||||
ReflectionObject::IsInstantiable() - invalid params
|
||||
--FILE--
|
||||
<?php
|
||||
class privateCtorOld {
|
||||
private function privateCtorOld() {}
|
||||
public static function reflectionObjectFactory() {
|
||||
return new ReflectionObject(new self);
|
||||
}
|
||||
}
|
||||
$reflectionObject = privateCtorOld::reflectionObjectFactory();
|
||||
|
||||
var_dump($reflectionObject->IsInstantiable('X'));
|
||||
var_dump($reflectionObject->IsInstantiable(0, null));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; privateCtorOld has a deprecated constructor in %s on line %d
|
||||
|
||||
Warning: ReflectionClass::isInstantiable() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::isInstantiable() expects exactly 0 parameters, 2 given in %s on line %d
|
||||
NULL
|
@ -1,15 +0,0 @@
|
||||
--TEST--
|
||||
ReflectionObject::isInternal() - invalid params
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$r1 = new ReflectionObject(new stdClass);
|
||||
var_dump($r1->isInternal('X'));
|
||||
var_dump($r1->isInternal('X', true));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: ReflectionClass::isInternal() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::isInternal() expects exactly 0 parameters, 2 given in %s on line %d
|
||||
NULL
|
@ -1,15 +0,0 @@
|
||||
--TEST--
|
||||
ReflectionObject::isUserDefined() - invalid params
|
||||
--FILE--
|
||||
<?php
|
||||
$r1 = new ReflectionObject(new stdClass);
|
||||
|
||||
var_dump($r1->isUserDefined('X'));
|
||||
var_dump($r1->isUserDefined('X', true));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: ReflectionClass::isUserDefined() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: ReflectionClass::isUserDefined() expects exactly 0 parameters, 2 given in %s on line %d
|
||||
NULL
|
Loading…
Reference in New Issue
Block a user