tests = array(); } public function init($tests_path) { $this->tests = array(); $files = array_diff(scandir($tests_path), array('.', '..')); foreach ($files as $file) { $name = basename($file, ".php"); require_once($tests_path."/".$file); $this->tests[$name] = new $name(); } uksort($this->tests, "cmpTest"); } public function getDescriptions() { return $this->run(TRUE); } public function run($descriptionsOnly = FALSE) { $results = array(); foreach ($this->tests as $name => $test) { $res = array(); foreach ($test->getWSTypes() as $ws_type) { $res = array( "name" => $name, "description" => $test->getDescription(), "type" => $ws_type, "api" => $test->getAPI(), "params" => $test->getParams(), "status" => NULL, ); if (!$descriptionsOnly) { $runFunc = "run".$ws_type; $res["status"] = $test->$runFunc(webAlias); } $results[] = $res; } } return $results; } } ?>