cvs: pear /Validate/tests validate_functions.inc
| From: | Ken Guest | Date: | Wed, 12 Sep 2007 22:13:50 +0000 |
| Subject: | cvs: pear /Validate/tests validate_functions.inc | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-48596@lists.php.net to get a copy of this message | ||
kguest Wed Sep 12 22:13:50 2007 UTC
Modified files:
/pear/Validate/tests validate_functions.inc
Log:
don't display extra parameters as they may cause a test to fail. tidied code also
http://cvs.php.net/viewvc.cgi/pear/Validate/tests/validate_functions.inc?r1=1.1&r2=1.2&diff_format=u
Index: pear/Validate/tests/validate_functions.inc
diff -u pear/Validate/tests/validate_functions.inc:1.1
pear/Validate/tests/validate_functions.inc:1.2
--- pear/Validate/tests/validate_functions.inc:1.1 Mon Aug 13 22:20:25 2007
+++ pear/Validate/tests/validate_functions.inc Wed Sep 12 22:13:50 2007
@@ -1,4 +1,4 @@
-<?php // $Id: validate_functions.inc,v 1.1 2007/08/13 22:20:25 moosh Exp $
+<?php // $Id: validate_functions.inc,v 1.2 2007/09/12 22:13:50 kguest Exp $
/**
* this helper function can uniformize layout of testing.
@@ -19,28 +19,24 @@
if(!is_array($scndParam)) $scndParam = array($scndParam);
echo "---------\nTest " . $func_name[0] . "::" . $func_name[1] .
"\n";
- if(count($scndParam))
- echo "extra params:" . implode('|',$scndParam) . "\n";
echo ' _ Value State Return' . "\n";
echo ' V = validation result is right' . "\n";
echo ' X = validation result is wrong' . "\n";
foreach ($data as $value => $resultWaited) {
- if (
- (is_array($func_name) && method_exists($func_name[0],$func_name[1]))
- ||
- function_exists($func_name))
-
- $result = $noYes[call_user_func_array($func_name,array_merge(array($value),$scndParam))];
- else echo 'Not found ' . implode('::',$func_name);
-
- echo ($resultWaited == $result
- ? ' V '
- : '!X!')
- .str_pad($value, 20) . " : ".$resultWaited . ' ' . $result
."\n";
+ if ((is_array($func_name) &&
+ method_exists($func_name[0],$func_name[1])) ||
+ function_exists($func_name)) {
+ $result =
$noYes[call_user_func_array($func_name,array_merge(array($value),$scndParam))];
+ } else {
+ echo 'Not found ' . implode('::',$func_name);
+ }
+
+ echo ($resultWaited == $result ? ' V ' : '!X!') .
+ str_pad($value, 20) . " : ".$resultWaited . ' ' . $result
."\n";
}
return ($resultWaited != $result );
}
-?>
\ No newline at end of file
+?>