public function text_area($name, $html_attributes = array()) { $value = strval($this->get_model_data($name)); return FormTagHelper::text_area_tag($this->get_field_name($name), $value, $html_attributes); }
public function test_text_area_tag() { $actual = FormTagHelper::text_area_tag('foo'); $matcher = array('tag' => 'textarea', 'attributes' => array('id' => 'foo', 'name' => 'foo'), 'content' => null); $this->assertTag($matcher, $actual, 'Default attributes'); $actual = FormTagHelper::text_area_tag('foo', 'bar'); $matcher = array('tag' => 'textarea', 'attributes' => array('id' => 'foo', 'name' => 'foo'), 'content' => 'bar'); $this->assertTag($matcher, $actual, 'with contents'); $actual = FormTagHelper::text_area_tag('foo', 'bar', array('class' => 'blah')); $this->assertRegexp('/class="blah"/', $actual, "Additional attributes"); }