function test_ajax_generate_script_tag_no_output_when_no_code() { $html = ajax_generate_script_tag(''); $this->assertEqual($html, ''); }
/** * Return the required JavaScript immediately, so it can be included in some * HTML that is being built. * @return string The HTML for the script tag. The caller * is responsible for making sure it is output. */ public function now() { if ($this->is_done()) { return ''; } $js = $this->get_js_code(); $output = ajax_generate_script_tag($js); $this->mark_done(); return $output; }