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
7070 $ errors = [];
7171 foreach ($ cartItem ->getErrorInfos () as $ error ) {
7272 $ errorType = $ error ['code ' ] ?? self ::ERROR_UNDEFINED ;
73- $ message = $ error ['message ' ] ?? $ cartItem ->getMessage ();
73+ $ message = ( string ) ( $ error ['message ' ] ?? $ cartItem ->getMessage () );
7474 $ errorEnumCode = $ this ->enumLookup ->getEnumValueFromField (
7575 'CartItemErrorType ' ,
7676 (string )$ errorType
Original file line number Diff line number Diff line change @@ -123,6 +123,10 @@ public function testConfigurableProductInCartAfterGoesOutOfStock()
123123 value
124124 }
125125 }
126+ errors {
127+ code
128+ message
129+ }
126130 }
127131 }
128132}
@@ -149,5 +153,6 @@ public function testConfigurableProductInCartAfterGoesOutOfStock()
149153 $ response ['cart ' ]['items ' ][0 ]['product ' ]['price_range ' ]['maximum_price ' ]['final_price ' ]['value ' ],
150154 'Assert that maximum price equals to 0 '
151155 );
156+ $ this ->assertEquals ('ITEM_QTY ' , $ response ['cart ' ]['items ' ][0 ]['errors ' ][0 ]['code ' ]);
152157 }
153158}
You can’t perform that action at this time.
0 commit comments