function testLib_select_yes_or_no() { // this requires html include_once "html.inc"; $this->set_text(lib_select_yes_or_no("fubar", "No")); $this->set_msg("test 1"); $expect[0] = "[ \n]+<select name=\"fubar\" size=\"0\">"; $expect[1] = "[ \n]+<option value=\"Yes\">Yes"; $expect[2] = "[ \n]+<option selected value=\"No\">No"; $expect[3] = "[ \n]+<\\/select>[ \n]+"; $this->_testFor_pattern(implode('', $expect)); $this->_testFor_string_length(118); $this->set_text(lib_select_yes_or_no("fubar", "Yes")); $this->set_msg('test 2'); $expect[1] = "[ \n]+<option selected value=\"Yes\">Yes"; $expect[2] = "[ \n]+<option value=\"No\">No"; $this->_testFor_pattern(implode('', $expect)); $this->_testFor_string_length(118); $this->set_text(lib_select_yes_or_no("fubar", "")); $this->set_msg('test 3'); $expect[1] = "[ \n]+<option value=\"Yes\">Yes"; $this->_testFor_pattern(implode('', $expect)); $this->_testFor_string_length(109); }
function _configure_form_checkfor_parts($mask) { global $quorum, $other_tech_contents, $other_developing_proposals, $consultants, $t; $tit = array(0 => 'Quorum for decision making', 1 => 'Other technical contents?', 2 => 'Other developing proposals?', 3 => 'Consultants?'); $val = array(0 => select_quorum($quorum), 1 => lib_select_yes_or_no("other_tech_contents", $other_tech_contents), 2 => lib_select_yes_or_no("other_developing_proposals", $other_developing_proposals), 3 => lib_select_yes_or_no("consultants", $consultants)); for ($idx = 0; $idx < 4; $idx++) { if ($mask[$idx]) { $this->_checkFor_column_titles(array($tit[$idx]), 'right', '30%', '', '<b>%s</b>: '); $this->_checkFor_column_values(array($val[$idx])); } else { $this->reverse_next_test(); $this->_testFor_pattern($this->_to_regexp($val[$idx])); $this->reverse_next_test(); $this->_testFor_pattern($this->_to_regexp($t->translate($tit[$idx]))); } } }