diff --git a/extra/index.php b/extra/index.php new file mode 100644 index 00000000..d1c974a8 --- /dev/null +++ b/extra/index.php @@ -0,0 +1,503 @@ +status = ''; + $output->failures = array(); + $output->testcount = 0; + $output->totaltests = 0; + + $thisrun = 0; + foreach ($content as $item) { + if ($item->event == 'suiteStart') { + if ($item->suite == '') { + $output->totaltests += $item->tests; + } else { + $thisrun = $item->tests; + } + } else if ($item->event == 'test') { + if ($item->status == 'pass') { + $output->status .= '.'; + $output->testcount++; + $thisrun--; + } else { + $output->status .= 'F'; + $output->failures = $item; + $output->testcount += $thisrun; + } + } + } + echo json_encode($output); + die; + } + + public static function get_instances() { + + static $instances = null; + + if ($instances !== null) { + return $instances; + } + + // Assume that we are in the mdk extras directory. + $path = dirname(getcwd()); + $dirs = scandir($path); + + // Instances have three types: + $instances = array( + FEATURE => array(), + INTEGRATION => array(), + STABLE => array(), + ); + + foreach ($dirs as $dir) { + $name = $dir; + $fulldir = $path . DIRECTORY_SEPARATOR . $dir; + if ($dir == '.' || $dir == '..' || !is_dir($fulldir)) { + continue; + } + if (!file_exists($fulldir . "/lib/moodlelib.php")) { + continue; + } + + $type = 'stable'; + + if (preg_match('/^s.*/', $name)) { + $type = STABLE; + } else if (preg_match('/^i.*/', $name)) { + $type = INTEGRATION; + } else { + $type = FEATURE; + } + + $instances[$type][$fulldir] = $name; + } + + return $instances; + } +} +?> + + +
+ + + +| Instance | +Type | +MDK Extra | +PHPUnit | +Behat | ++ + + + | ++ {$type} + | +
+
+
+EOF;
+echo <<|
+EOF;
+echo << |
+EOF;
+echo << | |
|---|