public function test_submit_post($additional_post_data, $expected_before, $expected_after) { $sql = 'SELECT user_id, item_id, item_parent_id FROM ' . NOTIFICATIONS_TABLE . ' n, ' . NOTIFICATION_TYPES_TABLE . " nt\n\t\t\tWHERE nt.notification_type_name = '" . $this->item_type . "'\n\t\t\t\tAND n.notification_type_id = nt.notification_type_id\n\t\t\tORDER BY user_id ASC, item_id ASC"; $result = $this->db->sql_query($sql); $this->assertEquals($expected_before, $this->db->sql_fetchrowset($result)); $this->db->sql_freeresult($result); $poll_data = $this->poll_data; $post_data = array_merge($this->post_data, $additional_post_data); submit_post('reply', '', 'poster-name', POST_NORMAL, $poll_data, $post_data, false, false); $result = $this->db->sql_query($sql); $this->assertEquals($expected_after, $this->db->sql_fetchrowset($result)); $this->db->sql_freeresult($result); }