/** * Obtain the string value of the form, depending on its * current output status. This will either return the * starting or ending <form> tag if start() or end() were * previously called, respectively. Otherwise, an empty * string is returned. * * @return string Start or end tag, or empty string */ public function __toString() { switch ($this->status) { case 'start': $text = FormTagHelper::start_form_tag($this->start_tag_attributes); break; case 'end': $text = FormTagHelper::end_form_tag(); break; default: $text = ''; break; } $this->status = null; return $text; }
public function test_form_end_tag() { $this->assertEquals('</form>', FormTagHelper::end_form_tag()); }