Skip to content

Commit 568b2cd

Browse files
committed
MAGETWO-48820: Refactor UI component to merge metadata
1 parent 8e4b05e commit 568b2cd

File tree

1 file changed

+42
-27
lines changed

1 file changed

+42
-27
lines changed

app/code/Magento/Customer/Test/Unit/Model/Customer/DataProviderTest.php

Lines changed: 42 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Magento\Eav\Model\Config;
99
use Magento\Eav\Model\Entity\Type;
1010
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
11+
use Magento\Ui\Component\Form\Field;
1112
use Magento\Ui\DataProvider\EavValidationRules;
1213
use Magento\Customer\Model\Customer\DataProvider;
1314
use Magento\Eav\Model\Entity\Attribute\AbstractAttribute;
@@ -100,37 +101,51 @@ public function getAttributesMetaDataProvider()
100101
[
101102
'expected' => [
102103
'customer' => [
103-
'fields' => [
104+
'children' => [
104105
self::ATTRIBUTE_CODE => [
105-
'dataType' => 'frontend_input',
106-
'formElement' => 'frontend_input',
107-
'options' => 'test-options',
108-
'visible' => 'is_visible',
109-
'required' => 'is_required',
110-
'label' => 'frontend_label',
111-
'sortOrder' => 'sort_order',
112-
'notice' => 'note',
113-
'default' => 'default_value',
114-
'size' => 'multiline_count',
115-
]
116-
]
106+
'arguments' => [
107+
'data' => [
108+
'config' => [
109+
'dataType' => 'frontend_input',
110+
'formElement' => 'frontend_input',
111+
'options' => 'test-options',
112+
'visible' => 'is_visible',
113+
'required' => 'is_required',
114+
'label' => 'frontend_label',
115+
'sortOrder' => 'sort_order',
116+
'notice' => 'note',
117+
'default' => 'default_value',
118+
'size' => 'multiline_count',
119+
'componentType' => Field::NAME,
120+
],
121+
],
122+
],
123+
],
124+
],
117125
],
118126
'address' => [
119-
'fields' => [
127+
'children' => [
120128
self::ATTRIBUTE_CODE => [
121-
'dataType' => 'frontend_input',
122-
'formElement' => 'frontend_input',
123-
'options' => 'test-options',
124-
'visible' => 'is_visible',
125-
'required' => 'is_required',
126-
'label' => 'frontend_label',
127-
'sortOrder' => 'sort_order',
128-
'notice' => 'note',
129-
'default' => 'default_value',
130-
'size' => 'multiline_count',
131-
]
132-
]
133-
]
129+
'arguments' => [
130+
'data' => [
131+
'config' => [
132+
'dataType' => 'frontend_input',
133+
'formElement' => 'frontend_input',
134+
'options' => 'test-options',
135+
'visible' => 'is_visible',
136+
'required' => 'is_required',
137+
'label' => 'frontend_label',
138+
'sortOrder' => 'sort_order',
139+
'notice' => 'note',
140+
'default' => 'default_value',
141+
'size' => 'multiline_count',
142+
'componentType' => Field::NAME,
143+
],
144+
],
145+
],
146+
],
147+
],
148+
],
134149
]
135150
]
136151
];

0 commit comments

Comments
 (0)