Mod setArray macro for nested values
This commit is contained in:
parent
396563e6e1
commit
092227d1e8
|
@ -174,10 +174,17 @@ class TestCase extends BaseTestCase
|
|||
return $this;
|
||||
});
|
||||
|
||||
Testable::macro('setArray', function ($attributes) {
|
||||
Testable::macro('setArray', function ($attributes, $value = null) {
|
||||
$self = $this;
|
||||
foreach ($attributes as $key => $value) {
|
||||
$self = $this->set($key, $value);
|
||||
if ($value === null) {
|
||||
foreach ($attributes as $key => $value) {
|
||||
$self = $this->set($key, $value);
|
||||
}
|
||||
return $self;
|
||||
}
|
||||
|
||||
foreach ($value as $key => $v) {
|
||||
$self = $self->set($attributes . '.' . $key, $v);
|
||||
}
|
||||
|
||||
return $self;
|
||||
|
|
Loading…
Reference in New Issue