Example #1
0
 public function doTest()
 {
     $report = new TestReport();
     $report->setName("Cross-Site Scripting (XSS)");
     $report->addResult($this->reflectedXss());
     return $report;
 }
Example #2
0
        } else {
            $data['fail'][$arrPosFa++] = array("file Writabel" => "No Writabel");
        }
        if ($this->checkVersion()) {
            $data['success'][$arrPosSu++] = array("ext-map verison" => "0.0.1");
        } else {
            $data['fail'][$arrPosFa++] = array("ext-map verison" => $this->realVersion);
        }
        if ($this->checkFileMulti()) {
            $data['success'][$arrPosSu++] = array("multi map" => "success");
        } else {
            $data['fail'][$arrPosFa++] = array("multi map" => "fail");
        }
        if ($this->checkFileOne()) {
            $data['success'][$arrPosSu++] = array("one map" => "success");
        } else {
            $data['fail'][$arrPosFa++] = array("one map" => "fail");
        }
        $data['name'] = "auto-plugin";
        $this->data = $data;
    }
    public function getData()
    {
        return $this->data;
    }
}
$myTest = new TestAutoPlugin();
$myTest->startTest();
$myReport = new TestReport();
$myReport->setData($myTest->getData());
$myReport->createTestReport();
Example #3
0
                    $outdata = $data;
                    $tmp = $key2;
                }
                unset($data);
            }
            if (!array_key_exists($tmp, $hash)) {
                foreach ($outdata as $v) {
                    array_push($this->data["fail"], $v);
                }
                $hash[$tmp] = 1;
            }
            unset($outdata);
        }
    }
    public function getResult()
    {
        $this->calculate($this->fileData1, $this->fileData2);
        $this->data["name"] = "autopack";
        $this->data['success'][0] = array("diff autopack" => "success");
    }
    public function getData()
    {
        return $this->data;
    }
}
$case = new TestStaticPack();
$case->setFile("a.txt", "b.txt");
$case->getResult();
$report = new TestReport();
$report->setData($case->getData());
$report->createTestReport();
Example #4
0
if (array_key_exists('h', $options)) {
    print $Usage;
    exit(0);
}
if (array_key_exists('f', $options)) {
    $filePath = $options['f'];
    if (!strlen($filePath)) {
        print $Usage;
        exit(1);
    }
    if (!file_exists($filePath)) {
        print "Error! {$filePath} does not exist or is not readable\n";
        exit(1);
    }
}
$tr = new TestReport($filePath);
$results = $tr->parseResultsFile($filePath);
//print "got back the following from parseResultsFile:\n";
//print_r($results) . "\n";
$totalPasses = 0;
$totalFailures = 0;
$totalExceptions = 0;
/**
 * groupByType
 *
 * group a failure type by suite.  Used to gather up all failures or exceptions
 * for a given test suite.
 *
 * @param string $suiteName the name of the test suite
 * @param array $list an array of keys => array (the list)
 * @return array $failType