2005-12-02 02:22:11 +08:00
|
|
|
--TEST--
|
|
|
|
token_get_all() and wrong parameters
|
2005-12-21 19:42:06 +08:00
|
|
|
--SKIPIF--
|
|
|
|
<?php if (!extension_loaded("tokenizer")) print "skip"; ?>
|
2005-12-02 02:22:11 +08:00
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
|
|
|
|
var_dump(token_get_all(array()));
|
|
|
|
var_dump(token_get_all(new stdClass));
|
|
|
|
var_dump(token_get_all(""));
|
|
|
|
var_dump(token_get_all(0));
|
|
|
|
var_dump(token_get_all(-1));
|
|
|
|
|
|
|
|
echo "Done\n";
|
|
|
|
?>
|
|
|
|
--EXPECTF--
|
|
|
|
Warning: token_get_all() expects parameter 1 to be string, array given in %s on line %d
|
|
|
|
NULL
|
|
|
|
|
|
|
|
Warning: token_get_all() expects parameter 1 to be string, object given in %s on line %d
|
|
|
|
NULL
|
|
|
|
array(0) {
|
|
|
|
}
|
|
|
|
array(1) {
|
|
|
|
[0]=>
|
2007-04-08 08:18:38 +08:00
|
|
|
array(3) {
|
2005-12-02 02:22:11 +08:00
|
|
|
[0]=>
|
2006-04-20 09:06:58 +08:00
|
|
|
int(%d)
|
2005-12-02 02:22:11 +08:00
|
|
|
[1]=>
|
|
|
|
string(1) "0"
|
2007-04-08 08:18:38 +08:00
|
|
|
[2]=>
|
|
|
|
int(1)
|
2005-12-02 02:22:11 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
array(1) {
|
|
|
|
[0]=>
|
2007-04-08 08:18:38 +08:00
|
|
|
array(3) {
|
2005-12-02 02:22:11 +08:00
|
|
|
[0]=>
|
2006-04-20 09:06:58 +08:00
|
|
|
int(%d)
|
2005-12-02 02:22:11 +08:00
|
|
|
[1]=>
|
|
|
|
string(2) "-1"
|
2007-04-08 08:18:38 +08:00
|
|
|
[2]=>
|
|
|
|
int(1)
|
2005-12-02 02:22:11 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
Done
|