File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
app/code/Magento/QuoteGraphQl/Model/Resolver
dev/tests/api-functional/testsuite/Magento/GraphQl/Quote Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ private function getItemErrors(Item $cartItem): ?array
70
70
$ errors = [];
71
71
foreach ($ cartItem ->getErrorInfos () as $ error ) {
72
72
$ errorType = $ error ['code ' ] ?? self ::ERROR_UNDEFINED ;
73
- $ message = $ error ['message ' ] ?? $ cartItem ->getMessage ();
73
+ $ message = ( string ) ( $ error ['message ' ] ?? $ cartItem ->getMessage () );
74
74
$ errorEnumCode = $ this ->enumLookup ->getEnumValueFromField (
75
75
'CartItemErrorType ' ,
76
76
(string )$ errorType
Original file line number Diff line number Diff line change @@ -123,6 +123,10 @@ public function testConfigurableProductInCartAfterGoesOutOfStock()
123
123
value
124
124
}
125
125
}
126
+ errors {
127
+ code
128
+ message
129
+ }
126
130
}
127
131
}
128
132
}
@@ -149,5 +153,6 @@ public function testConfigurableProductInCartAfterGoesOutOfStock()
149
153
$ response ['cart ' ]['items ' ][0 ]['product ' ]['price_range ' ]['maximum_price ' ]['final_price ' ]['value ' ],
150
154
'Assert that maximum price equals to 0 '
151
155
);
156
+ $ this ->assertEquals ('ITEM_QTY ' , $ response ['cart ' ]['items ' ][0 ]['errors ' ][0 ]['code ' ]);
152
157
}
153
158
}
You can’t perform that action at this time.
0 commit comments