Beispiel #1
0
 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());
 }
Beispiel #2
0
 /**
  * @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;
 }