File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
app/code/Magento/Wishlist Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -472,7 +472,7 @@ public function getProductUrl()
472
472
public function getBuyRequest ()
473
473
{
474
474
$ option = $ this ->getOptionByCode ('info_buyRequest ' );
475
- $ initialData = $ option ? unserialize ($ option ->getValue ()) : null ;
475
+ $ initialData = $ option ? unserialize ($ option ->getValue ()) : [] ;
476
476
477
477
if ($ initialData instanceof \Magento \Framework \DataObject) {
478
478
$ initialData = $ initialData ->getData ();
Original file line number Diff line number Diff line change @@ -323,4 +323,15 @@ public function testGetProduct()
323
323
->willReturn ($ productMock );
324
324
$ this ->assertEquals ($ productMock , $ this ->model ->getProduct ());
325
325
}
326
+
327
+ public function testGetBuyRequestWithNoOption ()
328
+ {
329
+ $ buyRequest = $ this ->model ->getBuyRequest ();
330
+
331
+ $ this ->assertInstanceOf (\Magento \Framework \DataObject::class, $ buyRequest );
332
+ $ this ->assertEquals ([
333
+ 'qty ' => 0 ,
334
+ 'original_qty ' => null
335
+ ], $ buyRequest ->getData ());
336
+ }
326
337
}
You can’t perform that action at this time.
0 commit comments