Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0918dac79f | ||
|
|
28a91965be | ||
|
|
f1eddc7a78 | ||
|
|
745c10226d | ||
|
|
a0a763779d | ||
|
|
e4b32919a3 |
No files matched your search
@@ -1,7 +1,6 @@
|
|||||||
language: php
|
language: php
|
||||||
|
|
||||||
php:
|
php:
|
||||||
- 5.4
|
|
||||||
- 5.5
|
- 5.5
|
||||||
- 5.6
|
- 5.6
|
||||||
- hhvm
|
- hhvm
|
||||||
|
|||||||
+5
-5
@@ -12,11 +12,11 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.4.0",
|
"php": ">=5.5.9",
|
||||||
"illuminate/http": "~5.0",
|
"illuminate/http": "5.1.*",
|
||||||
"illuminate/routing": "~5.0",
|
"illuminate/routing": "5.1.*",
|
||||||
"illuminate/session": "~5.0",
|
"illuminate/session": "5.1.*",
|
||||||
"illuminate/support": "~5.0"
|
"illuminate/support": "5.1.*"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"mockery/mockery": "~0.9",
|
"mockery/mockery": "~0.9",
|
||||||
|
|||||||
+1
-8
@@ -935,14 +935,7 @@ class FormBuilder {
|
|||||||
*/
|
*/
|
||||||
protected function getModelValueAttribute($name)
|
protected function getModelValueAttribute($name)
|
||||||
{
|
{
|
||||||
if (is_object($this->model))
|
return data_get($this->model, $this->transformKey($name));
|
||||||
{
|
|
||||||
return object_get($this->model, $this->transformKey($name));
|
|
||||||
}
|
|
||||||
elseif (is_array($this->model))
|
|
||||||
{
|
|
||||||
return array_get($this->model, $this->transformKey($name));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -137,6 +137,18 @@ class FormBuilderTest extends PHPUnit_Framework_TestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function testFormRepopulationWithMixOfArraysAndObjects()
|
||||||
|
{
|
||||||
|
$this->formBuilder->model(['user' => (object)['password' => 'apple']]);
|
||||||
|
$input = $this->formBuilder->text('user[password]');
|
||||||
|
$this->assertEquals('<input name="user[password]" type="text" value="apple">', $input);
|
||||||
|
|
||||||
|
$this->formBuilder->model((object)['letters' => ['a', 'b', 'c']]);
|
||||||
|
$input = $this->formBuilder->text('letters[1]');
|
||||||
|
$this->assertEquals('<input name="letters[1]" type="text" value="b">', $input);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function testFormPassword()
|
public function testFormPassword()
|
||||||
{
|
{
|
||||||
$form1 = $this->formBuilder->password('foo');
|
$form1 = $this->formBuilder->password('foo');
|
||||||
|
|||||||
Reference in new issue
Block a user