function testShow_referees() { global $t, $bx, $db; $db_config = new mock_db_configure(2); $pid1 = "this sit he proid"; $pid2 = "this sit he proid two"; $q = $this->queries['show_referees']; $db_config->add_query(sprintf($q, $pid1), 0); $db_config->add_num_row(0, 0); $db_config->add_num_row(0, 0); $db_config->add_query(sprintf($q, $pid2), 1); $dat = $this->_generate_records(array('username', 'status', 'creation'), 5); $db_config->add_num_row(count($dat), 1); $db_config->add_num_row(count($dat), 1); for ($idx = 0; $idx < count($dat); $idx++) { $db_config->add_record($dat[$idx], 1); } // test one, no record/data $bx = $this->_create_default_box(); $db = new DB_SourceAgency(); capture_reset_and_start(); show_referees($pid1); $this->set_text(capture_stop_and_get()); $this->push_msg("Test One"); $this->_testFor_string_length(72); $msg = $t->translate("There are no developers that have " . "offered themselves as referees"); $this->_testFor_pattern($this->_to_regexp($msg)); $this->pop_msg(); // test two, data is defined $bx = $this->_create_default_box(); $db = new DB_SourceAgency(); capture_reset_and_start(); show_referees($pid2); $this->set_text(capture_stop_and_get()); $this->push_msg("Test Two"); $this->_testFor_string_length(4940); $msg = $t->translate("There are no developers that have " . "offered themselves as referees"); $this->reverse_next_test(); $this->_testFor_pattern($this->_to_regexp($msg)); $this->_checkFor_a_box('Referees'); $this->_checkFor_columns(4); $this->_checkFor_column_titles(array('Number', 'Username', 'Status', 'Creation'), '', '', ''); $colors = array(0 => '#FFFFFF', 1 => 'gold'); for ($idx = 0; $idx < count($dat); $idx++) { $v = array("<b>" . ($idx + 1) . "</b>", '<b>' . lib_nick($dat[$idx]['username']) . '</b>', '<b>' . show_status($dat[$idx]['status']) . '</b>', '<b>' . timestr(mktimestamp($dat[$idx]['creation'])) . '</b>'); $this->push_msg("Test {$idx}"); $this->_checkFor_column_values($v, '', '', $colors[$idx % 2]); $this->pop_msg(); } $this->pop_msg(); $this->_check_db($db_config); }
# # This is the index file which shows the recent apps # # This program is free software. You can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 or later of the GPL. ###################################################################### require "include/prepend.php3"; page_open(array("sess" => "SourceAgency_Session")); if (isset($auth) && !empty($auth->auth["perm"])) { page_close(); page_open(array("sess" => "SourceAgency_Session", "auth" => "SourceAgency_Auth", "perm" => "SourceAgency_Perm")); } require "include/header.inc"; require "include/refereeslib.inc"; require "include/decisionslib.inc"; $bx = new box("100%", $th_box_frame_color, $th_box_frame_width, $th_box_title_bgcolor, $th_box_title_font_color, $th_box_title_align, $th_box_body_bgcolor, $th_box_body_font_color, $th_box_body_align); start_content(); $page = "referees"; if (check_proid($proid)) { top_bar($proid, $page); print $t->translate("Referee registration and selection. Any developer " . "who has the skills to be a referee can propose " . "himself as one") . ".\n"; print "<p align=right>[ <b>" . html_link("step4_edit.php", array("proid" => $proid), $t->translate("Propose yourself as referee")) . "</b> ]\n"; show_referees($proid); if (is_accepted_sponsor($proid) || is_main_developer($proid)) { create_decision_link($proid); } } end_content(); require "include/footer.inc"; @page_close();