File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed
dev/tests/api-functional/testsuite/Magento Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -498,6 +498,15 @@ protected function deleteProductBySku($productSku)
498
498
*/
499
499
protected function saveProduct ($ product )
500
500
{
501
+ if (isset ($ product ['custom_attributes ' ])) {
502
+ for ($ i =0 ; $ i <sizeof ($ product ['custom_attributes ' ]); $ i ++) {
503
+ if ($ product ['custom_attributes ' ][$ i ]['attribute_code ' ] == 'category_ids '
504
+ && !is_array ($ product ['custom_attributes ' ][$ i ]['value ' ])
505
+ ) {
506
+ $ product ['custom_attributes ' ][$ i ]['value ' ] = ["" ];
507
+ }
508
+ }
509
+ }
501
510
$ resourcePath = self ::RESOURCE_PATH . '/ ' . $ product ['sku ' ];
502
511
$ serviceInfo = [
503
512
'rest ' => [
Original file line number Diff line number Diff line change @@ -617,6 +617,15 @@ public function testUpdate()
617
617
*/
618
618
protected function updateProduct ($ product )
619
619
{
620
+ if (isset ($ product ['custom_attributes ' ])) {
621
+ for ($ i =0 ; $ i <sizeof ($ product ['custom_attributes ' ]); $ i ++) {
622
+ if ($ product ['custom_attributes ' ][$ i ]['attribute_code ' ] == 'category_ids '
623
+ && !is_array ($ product ['custom_attributes ' ][$ i ]['value ' ])
624
+ ) {
625
+ $ product ['custom_attributes ' ][$ i ]['value ' ] = ["" ];
626
+ }
627
+ }
628
+ }
620
629
$ sku = $ product [ProductInterface::SKU ];
621
630
if (TESTS_WEB_API_ADAPTER == self ::ADAPTER_REST ) {
622
631
$ product [ProductInterface::SKU ] = null ;
@@ -986,6 +995,15 @@ protected function getSimpleProductData($productData = [])
986
995
*/
987
996
protected function saveProduct ($ product , $ storeCode = null )
988
997
{
998
+ if (isset ($ product ['custom_attributes ' ])) {
999
+ for ($ i =0 ; $ i <sizeof ($ product ['custom_attributes ' ]); $ i ++) {
1000
+ if ($ product ['custom_attributes ' ][$ i ]['attribute_code ' ] == 'category_ids '
1001
+ && !is_array ($ product ['custom_attributes ' ][$ i ]['value ' ])
1002
+ ) {
1003
+ $ product ['custom_attributes ' ][$ i ]['value ' ] = ["" ];
1004
+ }
1005
+ }
1006
+ }
989
1007
$ serviceInfo = [
990
1008
'rest ' => [
991
1009
'resourcePath ' => self ::RESOURCE_PATH ,
You can’t perform that action at this time.
0 commit comments