21 function cleanString($string)
24 if(strlen($string) == 0)
28 $cleanText = str_replace(
"\n",
'', $string);
29 $clean =
trim($cleanText);
52 function checkStandard($list, $standard, $testName)
56 return(array(
'ERROR! empty list passed in'));
60 return(array(
'ERROR! empty Standard list passed in'));
62 if((strlen($testName)) == 0)
64 return(array(
'ERROR! no testName supplied'));
69 foreach($list as $uiData) {
70 $cleanText = cleanString($uiData[
'textOrLink']);
71 print
"ckSTDB: cleanText is:$cleanText\n";
72 if (array_key_exists($cleanText, $standard)) {
73 $stdCount = $standard[$cleanText];
74 if($stdCount != $uiData[
'count'])
76 $results[] =
"$testName FAILED! Should be $stdCount files " .
77 "got:$uiData[count] for row with text:\n$cleanText\n";
82 $results[] =
"$testName FAILED! $cleanText did not meet the test Standard\n";
char * trim(char *ptext)
Trimming whitespace.