Merge pull request #191 from aygee/get-form-value-related-model
Getting form value from related model
This commit is contained in:
commit
bcf0697d7d
3 files changed
+14
-1
No files matched your search
@@ -24,6 +24,9 @@ class FormAccessibleTest extends PHPUnit_Framework_TestCase
|
||||
$this->modelData = [
|
||||
'string' => 'abcdefghijklmnop',
|
||||
'email' => 'tj@tjshafer.com',
|
||||
'address' => [
|
||||
'street' => 'abcde st'
|
||||
],
|
||||
'created_at' => $this->now,
|
||||
'updated_at' => $this->now,
|
||||
];
|
||||
@@ -43,6 +46,12 @@ class FormAccessibleTest extends PHPUnit_Framework_TestCase
|
||||
$this->assertEquals($model->getFormValue('created_at'), $this->now->timestamp);
|
||||
}
|
||||
|
||||
public function testItCanGetRelatedValueForForms()
|
||||
{
|
||||
$model = new ModelThatUsesForms($this->modelData);
|
||||
$this->assertEquals($model->getFormValue('address.street'), 'abcde st');
|
||||
}
|
||||
|
||||
public function testItCanStillMutateValuesForViews()
|
||||
{
|
||||
$model = new ModelThatUsesForms($this->modelData);
|
||||
|
||||
Reference in new issue
Block a user