32 function cleanString($string)
35 if(strlen($string) == 0)
39 $cleanText = str_replace(
"\n",
'', $string);
40 $clean =
trim($cleanText);
63 function checkStandard($list, $standard, $testName)
67 return(array(
'ERROR! empty list passed in'));
71 return(array(
'ERROR! empty Standard list passed in'));
73 if((strlen($testName)) == 0)
75 return(array(
'ERROR! no testName supplied'));
80 foreach($list as $uiData) {
81 $cleanText = cleanString($uiData[
'textOrLink']);
82 print
"ckSTDB: cleanText is:$cleanText\n";
83 if (array_key_exists($cleanText, $standard)) {
84 $stdCount = $standard[$cleanText];
85 if($stdCount != $uiData[
'count'])
87 $results[] =
"$testName FAILED! Should be $stdCount files " .
88 "got:$uiData[count] for row with text:\n$cleanText\n";
93 $results[] =
"$testName FAILED! $cleanText did not meet the test Standard\n";
char * trim(char *ptext)
Trimming whitespace.