Compare commits

..
7 Commits
Author SHA1 Message Date
Robin Malfait c93974c835 Merge pull request #58 from kirkaracha/5.1
Added tel input type and test
2015-07-11 11:34:06 +02:00
Kirk Franklin 501aea5374 Added tel input type and test 2015-07-10 12:30:01 -07:00
Adam Engebretson 72d6ea9713 Merge pull request #57 from gregoryduckworth/5.1
Add time input
2015-07-02 12:07:57 -05:00
Greg Duckworth 5edfe5d8bb Added Time Tests 2015-07-01 16:23:04 +01:00
Greg Duckworth 42a626c23e Add time input
Added time input
2015-07-01 13:52:44 +01:00
Adam Engebretson 0918dac79f Removing PHP 5.4
Signed-off-by: Adam Engebretson <adam@enge.me>
2015-06-17 21:16:50 -05:00
Adam Engebretson 28a91965be Tagging 5.1 stable
Signed-off-by: Adam Engebretson <adam@enge.me>
2015-06-17 21:13:55 -05:00
4 changed files with 56 additions and 14 deletions

No files matched your search

-1
View File
@@ -1,7 +1,6 @@
language: php language: php
php: php:
- 5.4
- 5.5 - 5.5
- 5.6 - 5.6
- hhvm - hhvm
+6 -12
View File
@@ -12,11 +12,11 @@
} }
], ],
"require": { "require": {
"php": ">=5.4.0", "php": ">=5.5.9",
"illuminate/http": "~5.1", "illuminate/http": "5.1.*",
"illuminate/routing": "~5.1", "illuminate/routing": "5.1.*",
"illuminate/session": "~5.1", "illuminate/session": "5.1.*",
"illuminate/support": "~5.1" "illuminate/support": "5.1.*"
}, },
"require-dev": { "require-dev": {
"mockery/mockery": "~0.9", "mockery/mockery": "~0.9",
@@ -29,11 +29,5 @@
"files": [ "files": [
"src/helpers.php" "src/helpers.php"
] ]
}, }
"extra": {
"branch-alias": {
"dev-master": "5.1-dev"
}
},
"minimum-stability": "dev"
} }
+26
View File
@@ -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.
* *
@@ -330,6 +343,19 @@ class FormBuilder {
return $this->input('date', $name, $value, $options); 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. * Create a url input field.
* *
+24 -1
View File
@@ -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');
@@ -207,6 +219,17 @@ class FormBuilderTest extends PHPUnit_Framework_TestCase {
$this->assertEquals('<input class="span2" name="foo" type="date">', $form4); $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() public function testFormFile()
{ {
@@ -474,4 +497,4 @@ class FormBuilderModelStub {
{ {
return isset($this->data[$key]); return isset($this->data[$key]);
} }
} }