@@ -50,8 +50,9 @@ public function testGetItems()
50
50
51
51
/**
52
52
* @magentoApiDataFixture Magento/Catalog/Model/Product/Attribute/_files/select_attribute.php
53
+ * @dataProvider addDataProvider
53
54
*/
54
- public function testAdd ()
55
+ public function testAdd ($ optionData )
55
56
{
56
57
$ this ->_markTestAsRestOnly ('Fix inconsistencies in WSDL and Data interfaces ' );
57
58
$ testAttributeCode = 'select_attribute ' ;
@@ -67,18 +68,6 @@ public function testAdd()
67
68
],
68
69
];
69
70
70
- $ optionData = [
71
- AttributeOptionInterface::LABEL => 'new color ' ,
72
- AttributeOptionInterface::SORT_ORDER => 100 ,
73
- AttributeOptionInterface::IS_DEFAULT => true ,
74
- AttributeOptionInterface::STORE_LABELS => [
75
- [
76
- AttributeOptionLabelInterface::LABEL => 'DE label ' ,
77
- AttributeOptionLabelInterface::STORE_ID => 1 ,
78
- ],
79
- ],
80
- ];
81
-
82
71
$ response = $ this ->_webApiCall (
83
72
$ serviceInfo ,
84
73
[
@@ -96,6 +85,37 @@ public function testAdd()
96
85
);
97
86
}
98
87
88
+ /**
89
+ * @return array
90
+ */
91
+ public function addDataProvider ()
92
+ {
93
+ $ optionPayload = [
94
+ AttributeOptionInterface::LABEL => 'new color ' ,
95
+ AttributeOptionInterface::SORT_ORDER => 100 ,
96
+ AttributeOptionInterface::IS_DEFAULT => true ,
97
+ AttributeOptionInterface::STORE_LABELS => [
98
+ [
99
+ AttributeOptionLabelInterface::LABEL => 'DE label ' ,
100
+ AttributeOptionLabelInterface::STORE_ID => 1 ,
101
+ ],
102
+ ],
103
+ ];
104
+
105
+ return [
106
+ 'option_without_value_node ' => [
107
+ $ optionPayload
108
+ ],
109
+ 'option_with_value_node_that_starts_with_text ' => [
110
+ array_merge ($ optionPayload , [AttributeOptionInterface::VALUE => 'some_text ' ])
111
+ ],
112
+ 'option_with_value_node_that_starts_with_a_number ' => [
113
+ array_merge ($ optionPayload , [AttributeOptionInterface::VALUE => '123_some_text ' ])
114
+ ],
115
+
116
+ ];
117
+ }
118
+
99
119
/**
100
120
* @magentoApiDataFixture Magento/Catalog/Model/Product/Attribute/_files/select_attribute.php
101
121
*/
0 commit comments