Skip to content

Commit

Permalink
test(forFieldGroup): add multi dimensional array to forFieldGroup test
Browse files Browse the repository at this point in the history
  • Loading branch information
domtra committed Dec 13, 2016
1 parent 3ca2ed7 commit 3235129
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions tests/test-resolveConfigForFieldGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@ function testForFieldGroupWithValidConfig() {
'label' => 'Some Field',
'type' => 'someType'
];
$fieldConfigMulti = [
[
'name' => 'someField1',
'label' => 'Some Field1',
'type' => 'someType'
],
[
'name' => 'someField2',
'label' => 'Some Field2',
'type' => 'someType'
]
];
$locationConfig = [
'param' => 'someParam',
'operator' => 'someOperator',
Expand All @@ -24,7 +36,8 @@ function testForFieldGroupWithValidConfig() {
'title' => 'Some Group',
'fields' => [
$filterName,
$fieldConfig
$fieldConfig,
$fieldConfigMulti
],
'location' => [
[$locationConfig]
Expand All @@ -37,8 +50,10 @@ function testForFieldGroupWithValidConfig() {

$output = ResolveConfig::forFieldGroup($config);
$fieldConfig['key'] = 'field_someGroup_someField';
$fieldConfigMulti[0]['key'] = 'field_someGroup_someField1';
$fieldConfigMulti[1]['key'] = 'field_someGroup_someField2';
$config['key'] = 'group_someGroup';
$config['fields'] = [$fieldConfig, $fieldConfig];
$config['fields'] = [$fieldConfig, $fieldConfig, $fieldConfigMulti[0], $fieldConfigMulti[1]];
$this->assertEquals($config, $output);
}

Expand Down

0 comments on commit 3235129

Please sign in to comment.