tony2001 Wed Jul 19 08:25:45 2006 UTC Added files: /php-src/ext/filter/tests 033_run.inc
Removed files: /php-src/ext/filter/tests 033_run.php Modified files: /php-src/ext/filter/tests 007.phpt 011.phpt 014.phpt 033.phpt Log: fix tests http://cvs.php.net/viewvc.cgi/php-src/ext/filter/tests/007.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/filter/tests/007.phpt diff -u php-src/ext/filter/tests/007.phpt:1.1 php-src/ext/filter/tests/007.phpt:1.2 --- php-src/ext/filter/tests/007.phpt:1.1 Tue Dec 6 15:18:56 2005 +++ php-src/ext/filter/tests/007.phpt Wed Jul 19 08:25:45 2006 @@ -35,7 +35,6 @@ bool(false) bool(false) bool(false) -PHP Warning: input_has_variable() expects parameter 2 to be string, array given in %s on line %d Warning: input_has_variable() expects parameter 2 to be string, array given in %s on line %d NULL @@ -44,24 +43,19 @@ bool(false) bool(false) bool(false) -PHP Warning: input_has_variable() expects parameter 2 to be string, array given in %s on line %d Warning: input_has_variable() expects parameter 2 to be string, array given in %s on line %d NULL bool(false) -PHP Warning: input_has_variable() expects parameter 1 to be long, string given in %s on line %d Warning: input_has_variable() expects parameter 1 to be long, string given in %s on line %d NULL -PHP Warning: input_has_variable() expects parameter 1 to be long, array given in %s on line %d Warning: input_has_variable() expects parameter 1 to be long, array given in %s on line %d NULL -PHP Warning: input_has_variable() expects parameter 1 to be long, array given in %s on line %d Warning: input_has_variable() expects parameter 1 to be long, array given in %s on line %d NULL -PHP Warning: input_has_variable() expects parameter 1 to be long, string given in %s on line %d Warning: input_has_variable() expects parameter 1 to be long, string given in %s on line %d NULL http://cvs.php.net/viewvc.cgi/php-src/ext/filter/tests/011.phpt?r1=1.2&r2=1.3&diff_format=u Index: php-src/ext/filter/tests/011.phpt diff -u php-src/ext/filter/tests/011.phpt:1.2 php-src/ext/filter/tests/011.phpt:1.3 --- php-src/ext/filter/tests/011.phpt:1.2 Sat Jan 21 15:57:43 2006 +++ php-src/ext/filter/tests/011.phpt Wed Jul 19 08:25:45 2006 @@ -28,22 +28,19 @@ string(4) "test" string(18) "http://example.com" string(27) "<b>test</b>" -NULL +bool(false) string(6) "string" float(12345.7) string(29) "<p>string</p>" -NULL -PHP Warning: input_get() expects parameter 1 to be long, object given in %s on line %d +bool(false) Warning: input_get() expects parameter 1 to be long, object given in %s on line %d NULL -PHP Warning: input_get() expects parameter 3 to be long, string given in %s on line %d Warning: input_get() expects parameter 3 to be long, string given in %s on line %d NULL -PHP Warning: input_get() expects parameter 1 to be long, string given in %s on line %d Warning: input_get() expects parameter 1 to be long, string given in %s on line %d NULL -bool(false) +NULL Done http://cvs.php.net/viewvc.cgi/php-src/ext/filter/tests/014.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/filter/tests/014.phpt diff -u php-src/ext/filter/tests/014.phpt:1.3 php-src/ext/filter/tests/014.phpt:1.4 --- php-src/ext/filter/tests/014.phpt:1.3 Sat Jan 21 15:57:43 2006 +++ php-src/ext/filter/tests/014.phpt Wed Jul 19 08:25:45 2006 @@ -3,8 +3,19 @@ --FILE-- <?php +class test { + + function __toString() { + return "blah"; + } +} + +$t = new test; + var_dump(filter_data("no", FILTER_VALIDATE_BOOLEAN)); -var_dump(filter_data(new stdClass, FILTER_VALIDATE_BOOLEAN)); +var_dump(filter_data(NULL, FILTER_VALIDATE_BOOLEAN)); +var_dump(filter_data($t, FILTER_VALIDATE_BOOLEAN)); +var_dump(filter_data(array(1,2,3,0,array("", "123")), FILTER_VALIDATE_BOOLEAN)); var_dump(filter_data("yes", FILTER_VALIDATE_BOOLEAN)); var_dump(filter_data("true", FILTER_VALIDATE_BOOLEAN)); var_dump(filter_data("false", FILTER_VALIDATE_BOOLEAN)); @@ -23,9 +34,25 @@ ?> --EXPECTF-- bool(false) - -Notice: Object of class stdClass to string conversion in %s on line %d -NULL +bool(false) +bool(false) +array(5) { + [0]=> + bool(true) + [1]=> + bool(false) + [2]=> + bool(false) + [3]=> + bool(false) + [4]=> + array(2) { + [0]=> + bool(false) + [1]=> + bool(false) + } +} bool(true) bool(true) bool(false) @@ -33,9 +60,9 @@ bool(true) bool(false) bool(true) -NULL bool(false) -NULL -NULL -NULL +bool(false) +bool(false) +bool(false) +bool(false) Done http://cvs.php.net/viewvc.cgi/php-src/ext/filter/tests/033.phpt?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/filter/tests/033.phpt diff -u php-src/ext/filter/tests/033.phpt:1.3 php-src/ext/filter/tests/033.phpt:1.4 --- php-src/ext/filter/tests/033.phpt:1.3 Thu May 25 11:13:23 2006 +++ php-src/ext/filter/tests/033.phpt Wed Jul 19 08:25:45 2006 @@ -2,7 +2,7 @@ Test all filters returned by input_filters_list() --FILE-- <?php -include dirname(__FILE__) . '/033_run.php'; +include dirname(__FILE__) . '/033_run.inc'; ?> --EXPECT-- int 1 123 http://cvs.php.net/viewvc.cgi/php-src/ext/filter/tests/033_run.inc?view=markup&rev=1.1 Index: php-src/ext/filter/tests/033_run.inc +++ php-src/ext/filter/tests/033_run.inc <?php function test($data) { return strtoupper($data); } $data = array("PHP","1","[EMAIL PROTECTED]","http://a.b.c","1.2.3.4","123","123abc<>()","O'Henry", "íí¼"); foreach(input_filters_list() as $filter) { if($filter=="validate_regexp") { foreach($data as $k=>$d) $result[$k] = filter_data($d,input_name_to_filter($filter),array("regexp"=>'/^O.*/')); } else { foreach($data as $k=>$d) $result[$k] = filter_data($d,input_name_to_filter($filter),"test"); } printf("%-20s",$filter); printf("%-5s",$result[0]); printf("%-3s",$result[1]); printf("%-15s",$result[2]); printf("%-20s",$result[3]); printf("%-10s",$result[4]); printf("%-5s",$result[5]); printf("%-20s",$result[6]); printf("%-15s",$result[7]); printf("%-10s\n",$result[8]); } ?> -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php