commit
72d6ea9713
2 files changed
+25
-1
No files matched your search
@@ -329,6 +329,19 @@ class FormBuilder {
|
||||
|
||||
return $this->input('date', $name, $value, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a time input field.
|
||||
*
|
||||
* @param string $name
|
||||
* @param string $value
|
||||
* @param array $options
|
||||
* @return string
|
||||
*/
|
||||
public function time($name, $value = null, $options = array())
|
||||
{
|
||||
return $this->input('time', $name, $value, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a url input field.
|
||||
|
||||
@@ -207,7 +207,18 @@ class FormBuilderTest extends PHPUnit_Framework_TestCase {
|
||||
$this->assertEquals('<input class="span2" name="foo" type="date">', $form4);
|
||||
}
|
||||
|
||||
public function testFormTime()
|
||||
{
|
||||
$form1 = $this->formBuilder->time('foo');
|
||||
$form2 = $this->formBuilder->time('foo', \Carbon\Carbon::now()->format('H:i'));
|
||||
$form3 = $this->formBuilder->time('foo', null, ['class' => 'span2']);
|
||||
|
||||
$this->assertEquals('<input name="foo" type="time">', $form1);
|
||||
$this->assertEquals('<input name="foo" type="time" value="' . \Carbon\Carbon::now()->format('H:i') . '">', $form2);
|
||||
$this->assertEquals('<input class="span2" name="foo" type="time">', $form3);
|
||||
}
|
||||
|
||||
|
||||
public function testFormFile()
|
||||
{
|
||||
$form1 = $this->formBuilder->file('foo');
|
||||
@@ -474,4 +485,4 @@ class FormBuilderModelStub {
|
||||
{
|
||||
return isset($this->data[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user