Added tel input type and test
This commit is contained in:
1 parent
72d6ea9713
commit
501aea5374
2 files changed
+25
No files matched your search
@@ -299,6 +299,19 @@ class FormBuilder {
|
|||||||
return $this->input('email', $name, $value, $options);
|
return $this->input('email', $name, $value, $options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a tel input field.
|
||||||
|
*
|
||||||
|
* @param string $name
|
||||||
|
* @param string $value
|
||||||
|
* @param array $options
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function tel($name, $value = null, $options = array())
|
||||||
|
{
|
||||||
|
return $this->input('tel', $name, $value, $options);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a number input field.
|
* Create a number input field.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -183,6 +183,18 @@ class FormBuilderTest extends PHPUnit_Framework_TestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function testFormTel()
|
||||||
|
{
|
||||||
|
$form1 = $this->formBuilder->tel('foo');
|
||||||
|
$form2 = $this->formBuilder->tel('foo', 'foobar');
|
||||||
|
$form3 = $this->formBuilder->tel('foo', null, ['class' => 'span2']);
|
||||||
|
|
||||||
|
$this->assertEquals('<input name="foo" type="tel">', $form1);
|
||||||
|
$this->assertEquals('<input name="foo" type="tel" value="foobar">', $form2);
|
||||||
|
$this->assertEquals('<input class="span2" name="foo" type="tel">', $form3);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function testFormNumber()
|
public function testFormNumber()
|
||||||
{
|
{
|
||||||
$form1 = $this->formBuilder->number('foo');
|
$form1 = $this->formBuilder->number('foo');
|
||||||
|
|||||||
Reference in new issue
Block a user