function testRatings_in_history() { global $db, $t, $bx, $queries; $fname = 'ratings_in_history'; $db_config = new mock_db_configure(2); $qs = array(0 => $queries[$fname]); $args = $this->_generate_records(array('proid', 'history_user'), 10); $db_config->add_query(sprintf($qs[0], $args[0]['proid'], $args[0]['history_user'], $args[0]['history_user']), 0); $db_config->add_affected_rows(0, 0); $db_config->add_query(sprintf($qs[0], $args[1]['proid'], $args[1]['history_user'], $args[1]['history_user']), 1); $db_config->add_affected_rows(1, 1); // test one, insert failed $db = new DB_SourceAgency(); $bx = $this->_create_default_box(); $this->capture_call($fname, 0, $args[0]); // test two, insert succeeds $db = new DB_SourceAgency(); $bx = $this->_create_default_box(); $this->capture_call($fname, 782, $args[1]); $this->_check_db($db_config); }