public static function render_page_process($PATH) { $suite_dir = phoromatic_server::phoromatic_account_suite_path($_SESSION['AccountID']); $main = '<h1>Local Suites</h1><p>These are test suites created by you or another account within your group. Suites are an easy collection of test profiles. New suits can be trivially made via the <a href="/?build_suite">build suite</a> page.</p>'; $suite_count = 0; foreach (pts_file_io::glob($suite_dir . '*/suite-definition.xml') as $xml_path) { $suite_count++; $id = basename(dirname($xml_path)); $test_suite = new pts_test_suite($xml_path); $main .= '<a name="' . $id . '"></a><h1>' . $test_suite->get_title() . ' [' . $id . ']</h1>'; $main .= '<p><strong>' . $test_suite->get_maintainer() . '</strong></p>'; $main .= '<p><em>' . $test_suite->get_description() . '</em></p>'; $main .= '<div style="max-height: 200px; overflow-y: scroll;">'; foreach ($test_suite->get_contained_test_result_objects() as $tro) { $main .= '<h3>' . $tro->test_profile->get_title() . ' [' . $tro->test_profile->get_identifier() . ']</h3>'; $main .= '<p>' . $tro->get_arguments_description() . '</p>'; } $main .= '</div>'; $main .= '<hr />'; } if ($suite_count == 0) { $main .= '<h1>No Test Suites Found</h1>'; } echo phoromatic_webui_header_logged_in(); echo '<div id="pts_phoromatic_main_area">' . $main . '</div>'; echo phoromatic_webui_footer(); }
protected static function search_local_test_suites($q) { $ret = null; $suite_dir = phoromatic_server::phoromatic_account_suite_path($_SESSION['AccountID']); foreach (pts_file_io::glob($suite_dir . '*/suite-definition.xml') as $xml_path) { $id = basename(dirname($xml_path)); $test_suite = new pts_test_suite($xml_path); $match = false; if (stripos($test_suite->get_title(), $q) === 0 || stripos($test_suite->get_description(), $q) !== false) { $match = true; } else { foreach ($test_suite->get_contained_test_result_objects() as $tro) { if (stripos($tro->test_profile->get_identifier(), $q) !== false || stripos($tro->test_profile->get_title(), $q) === 0) { $match = true; } } } if ($match) { $ret .= '<h3>' . $test_suite->get_title() . '</h3><p>' . $test_suite->get_description() . '<br /><a href="/?local_suites#' . $id . '">More Details</a></p>'; } } return $ret; }