public function testDefaultValue()
 {
     $textarea = new TextArea('bio');
     $expected = '<textarea name="bio" rows="10" cols="50">My information</textarea>';
     $result = $textarea->defaultValue('My information')->render();
     $this->assertEquals($expected, $result);
     $textarea = new TextArea('description');
     $expected = '<textarea name="description" rows="10" cols="50">Your information</textarea>';
     $result = $textarea->defaultValue('Your information')->render();
     $this->assertEquals($expected, $result);
     $textarea = new TextArea('bio');
     $expected = '<textarea name="bio" rows="10" cols="50">Testing</textarea>';
     $result = $textarea->value('Testing')->defaultValue('My information')->render();
     $this->assertEquals($expected, $result);
     $textarea = new TextArea('description');
     $expected = '<textarea name="description" rows="10" cols="50">Testing</textarea>';
     $result = $textarea->value('Testing')->defaultValue('Your information')->render();
     $this->assertEquals($expected, $result);
     $textarea = new TextArea('bio');
     $expected = '<textarea name="bio" rows="10" cols="50">Testing</textarea>';
     $result = $textarea->defaultValue('My information')->value('Testing')->render();
     $this->assertEquals($expected, $result);
     $textarea = new TextArea('description');
     $expected = '<textarea name="description" rows="10" cols="50">Testing</textarea>';
     $result = $textarea->defaultValue('Your information')->value('Testing')->render();
     $this->assertEquals($expected, $result);
 }
 public function textarea($name, $defaultValue = null)
 {
     $textarea = new TextArea($name);
     if (!is_null($value = $this->getValueFor($name))) {
         $textarea->value($value);
     }
     $textarea->defaultValue($defaultValue);
     if ($this->hasError($name)) {
         $textarea->setError();
     }
     return $textarea;
 }
 public function textarea($name)
 {
     $textarea = new TextArea($name);
     if (!is_null($value = $this->getValueFor($name))) {
         $textarea->value($value);
     }
     return $textarea;
 }