Example #1
0
 public function text($name)
 {
     $text = new Text($name);
     if (!is_null($value = $this->getValueFor($name))) {
         $text->value($value);
     }
     return $text;
 }
Example #2
0
 public function testDefaultValue()
 {
     $text = new Text('email');
     $expected = '<input type="text" name="email" value="*****@*****.**">';
     $result = $text->defaultValue('*****@*****.**')->render();
     $this->assertEquals($expected, $result);
     $text = new Text('email');
     $expected = '<input type="text" name="email" value="*****@*****.**">';
     $result = $text->value('*****@*****.**')->defaultValue('*****@*****.**')->render();
     $this->assertEquals($expected, $result);
     $text = new Text('email');
     $expected = '<input type="text" name="email" value="*****@*****.**">';
     $result = $text->defaultValue('*****@*****.**')->value('*****@*****.**')->render();
     $this->assertEquals($expected, $result);
 }