public function testHandleRequest() { $element = new TextArea(); $element->setName('test'); $element->handle(new FormData('post', ['test' => 'test text'])); $this->assertEquals('test text', $element->getValue()); $element->handle(new FormData('post', [])); $this->assertNull($element->getValue()); }
/** * @param string $name * @param null $text * @return TextArea */ public function textarea($name, $text = null) { $input = new TextArea(); $input->setName($name); $input->setText($text); $this->addElement($input); return $input; }