@@ -23,6 +23,7 @@ public function testWrongFrontendInput()
23
23
'frontend_input ' => 'some_input ' ,
24
24
];
25
25
$ this ->getRequest ()->setPostValue ($ postData );
26
+ $ this ->getRequest ()->setMethod ('POST ' );
26
27
$ this ->dispatch ('backend/catalog/product_attribute/save ' );
27
28
$ this ->assertEquals (302 , $ this ->getResponse ()->getHttpResponseCode ());
28
29
$ this ->assertContains (
@@ -48,6 +49,7 @@ public function testWithPopup()
48
49
'new_attribute_set_name ' => 'new_attribute_set ' ,
49
50
];
50
51
$ this ->getRequest ()->setPostValue ($ postData );
52
+ $ this ->getRequest ()->setMethod ('POST ' );
51
53
$ this ->dispatch ('backend/catalog/product_attribute/save ' );
52
54
$ this ->assertEquals (302 , $ this ->getResponse ()->getHttpResponseCode ());
53
55
$ this ->assertContains (
@@ -67,6 +69,7 @@ public function testWithPopup()
67
69
public function testWithExceptionWhenSaveAttribute ()
68
70
{
69
71
$ postData = $ this ->_getAttributeData () + ['attribute_id ' => 0 , 'frontend_input ' => 'boolean ' ];
72
+ $ this ->getRequest ()->setMethod ('POST ' );
70
73
$ this ->getRequest ()->setPostValue ($ postData );
71
74
$ this ->dispatch ('backend/catalog/product_attribute/save ' );
72
75
$ this ->assertEquals (302 , $ this ->getResponse ()->getHttpResponseCode ());
@@ -85,6 +88,7 @@ public function testWithExceptionWhenSaveAttribute()
85
88
public function testWrongAttributeId ()
86
89
{
87
90
$ postData = $ this ->_getAttributeData () + ['attribute_id ' => 100500 ];
91
+ $ this ->getRequest ()->setMethod ('POST ' );
88
92
$ this ->getRequest ()->setPostValue ($ postData );
89
93
$ this ->dispatch ('backend/catalog/product_attribute/save ' );
90
94
$ this ->assertEquals (302 , $ this ->getResponse ()->getHttpResponseCode ());
@@ -110,6 +114,7 @@ public function testAttributeWithoutId()
110
114
'set ' => 4 ,
111
115
'frontend_input ' => 'boolean ' ,
112
116
];
117
+ $ this ->getRequest ()->setMethod ('POST ' );
113
118
$ this ->getRequest ()->setPostValue ($ postData );
114
119
$ this ->dispatch ('backend/catalog/product_attribute/save ' );
115
120
$ this ->assertEquals (302 , $ this ->getResponse ()->getHttpResponseCode ());
@@ -132,6 +137,7 @@ public function testWrongAttributeCode()
132
137
{
133
138
$ postData = $ this ->_getAttributeData () + ['attribute_code ' => '_()&&&? ' ];
134
139
$ this ->getRequest ()->setPostValue ($ postData );
140
+ $ this ->getRequest ()->setMethod ('POST ' );
135
141
$ this ->dispatch ('backend/catalog/product_attribute/save ' );
136
142
$ this ->assertEquals (302 , $ this ->getResponse ()->getHttpResponseCode ());
137
143
$ this ->assertContains (
@@ -157,6 +163,7 @@ public function testAttributeWithoutEntityTypeId()
157
163
{
158
164
$ postData = $ this ->_getAttributeData () + ['attribute_id ' => '2 ' , 'new_attribute_set_name ' => ' ' ];
159
165
$ this ->getRequest ()->setPostValue ($ postData );
166
+ $ this ->getRequest ()->setMethod ('POST ' );
160
167
$ this ->dispatch ('backend/catalog/product_attribute/save ' );
161
168
$ this ->assertEquals (302 , $ this ->getResponse ()->getHttpResponseCode ());
162
169
$ this ->assertContains (
@@ -172,6 +179,7 @@ public function testSaveActionApplyToDataSystemAttribute()
172
179
{
173
180
$ postData = $ this ->_getAttributeData () + ['attribute_id ' => '2 ' ];
174
181
$ this ->getRequest ()->setPostValue ($ postData );
182
+ $ this ->getRequest ()->setMethod ('POST ' );
175
183
$ this ->dispatch ('backend/catalog/product_attribute/save ' );
176
184
$ model = $ this ->_objectManager ->create (\Magento \Catalog \Model \ResourceModel \Eav \Attribute::class);
177
185
$ model ->load ($ postData ['attribute_id ' ]);
@@ -185,6 +193,7 @@ public function testSaveActionApplyToDataUserDefinedAttribute()
185
193
{
186
194
$ postData = $ this ->_getAttributeData () + ['attribute_id ' => '1 ' ];
187
195
$ this ->getRequest ()->setPostValue ($ postData );
196
+ $ this ->getRequest ()->setMethod ('POST ' );
188
197
$ this ->dispatch ('backend/catalog/product_attribute/save ' );
189
198
/** @var \Magento\Catalog\Model\ResourceModel\Eav\Attribute $model */
190
199
$ model = $ this ->_objectManager ->create (\Magento \Catalog \Model \ResourceModel \Eav \Attribute::class);
@@ -218,6 +227,7 @@ public function testSaveActionCleanAttributeLabelCache()
218
227
$ this ->assertEquals ('predefined string translation ' , $ this ->_translate ('string to translate ' ));
219
228
$ string ->saveTranslate ('string to translate ' , 'new string translation ' );
220
229
$ postData = $ this ->_getAttributeData () + ['attribute_id ' => 1 ];
230
+ $ this ->getRequest ()->setMethod ('POST ' );
221
231
$ this ->getRequest ()->setPostValue ($ postData );
222
232
$ this ->dispatch ('backend/catalog/product_attribute/save ' );
223
233
$ this ->assertEquals ('new string translation ' , $ this ->_translate ('string to translate ' ));
@@ -293,6 +303,7 @@ public function testLargeOptionsDataSet()
293
303
$ optionsData [] = http_build_query ($ optionRowData );
294
304
}
295
305
$ attributeData ['serialized_options ' ] = json_encode ($ optionsData );
306
+ $ this ->getRequest ()->setMethod ('POST ' );
296
307
$ this ->getRequest ()->setPostValue ($ attributeData );
297
308
$ this ->dispatch ('backend/catalog/product_attribute/save ' );
298
309
$ entityTypeId = $ this ->_objectManager ->create (
0 commit comments