Ejemplo n.º 1
0
        $bx->box_column_start("right", "33%", "");
        personal_consultants($auth->auth["uname"], "P");
        $bx->box_column_finish();
        $bx->box_column_start("right", "33%", "");
        personal_consultants($auth->auth["uname"], "R");
        $bx->box_column_finish();
        $bx->box_columns_end();
        $bx->box_body_end();
        $bx->box_end();
        $bx->box_begin();
        $bx->box_body_begin();
        $bx->box_columns_begin(3, 'top');
        $bx->box_column_start("right", "34%", "");
        personal_referees($auth->auth["uname"], "A");
        $bx->box_column_finish();
        $bx->box_column_start("right", "33%", "");
        personal_referees($auth->auth["uname"], "P");
        $bx->box_column_finish();
        $bx->box_column_start("right", "33%", "");
        personal_referees($auth->auth["uname"], "R");
        $bx->box_column_finish();
        $bx->box_columns_end();
        $bx->box_body_end();
        $bx->box_end();
    }
    personal_comments_short($auth->auth["uname"]);
    personal_news_short($auth->auth["uname"]);
}
end_content();
require "include/footer.inc";
@page_close();
 function testPersonal_referees()
 {
     global $bx;
     $user1 = "fubar";
     $status1 = "D";
     $user2 = "snafu";
     $status2 = "A";
     $user3 = "fritz";
     $status3 = "R";
     $db_config = new mock_db_configure(3);
     $db_q = "SELECT * FROM referees,description WHERE " . "referee='%s' AND referees.status='%s'" . " AND referees.proid=description.proid";
     $db_config->add_query(sprintf($db_q, $user1, $status1), 0);
     $db_config->add_query(sprintf($db_q, $user2, $status2), 1);
     $db_config->add_query(sprintf($db_q, $user3, $status3), 2);
     $db_config->add_num_row(0, 0);
     $db_config->add_num_row(1, 1);
     $db_config->add_num_row(2, 2);
     $cols = array('status', 'proid', 'project_title');
     // this is for the snafu query
     $row1 = $this->_generate_array($cols, 1);
     $db_config->add_record($row1, 1);
     $db_config->add_record(false, 1);
     // this is for the fritz query
     $row2 = $this->_generate_array($cols, 2);
     $db_config->add_record($row2, 2);
     $row3 = $this->_generate_array($cols, 3);
     $db_config->add_record($row3, 2);
     $db_config->add_record(false, 2);
     //
     // fubar query
     //
     $bx = $this->_create_default_box();
     capture_reset_and_start();
     // here next_record will not be called
     personal_referees($user1, $status1);
     $this->set_text(capture_stop_and_get());
     $this->set_msg('test 1');
     $this->_testFor_string_length(710);
     // check title string
     $this->_testFor_pattern("Referee [(]" . show_status($status1) . "[)]");
     $this->_testFor_pattern("No referee proposal with this status\n");
     //
     // snafu query
     //
     $bx = $this->_create_default_box();
     capture_reset_and_start();
     // here next_record will not be called
     personal_referees($user2, $status2);
     $this->set_text(capture_stop_and_get());
     $this->set_msg('test 2');
     $this->_testFor_string_length(774);
     // check title string
     $this->_testFor_pattern("Referee [(]" . show_status($status2) . "[)]");
     $this->_testFor_referee_project_link($row1['proid'], $row1['project_title'], $row1['status']);
     //
     // fritz query
     //
     $bx = $this->_create_default_box();
     capture_reset_and_start();
     // here next_record will not be called
     personal_referees($user3, $status3);
     $this->set_text(capture_stop_and_get());
     $this->set_msg('test 3');
     $this->_testFor_string_length(874);
     // check title string
     $this->_testFor_pattern("Referee [(]" . show_status($status3) . "[)]");
     $this->_testFor_referee_project_link($row2['proid'], $row2['project_title'], $row2['status']);
     $this->_testFor_referee_project_link($row3['proid'], $row3['project_title'], $row3['status']);
     // if using a database, then ensure that it didn't fail
     $this->_check_db($db_config);
 }