1313use Magento \Framework \App \Helper \Context ;
1414use Magento \Framework \App \RequestInterface ;
1515use Magento \Framework \Data \Helper \PostHelper ;
16+ use Magento \Framework \DataObject ;
1617use Magento \Framework \Registry ;
1718use Magento \Framework \TestFramework \Unit \Helper \ObjectManager ;
1819use Magento \Framework \Url \EncoderInterface ;
@@ -186,11 +187,27 @@ public function testGetConfigureUrl()
186187 {
187188 $ url = 'http://magento2ce/wishlist/index/configure/id/4/product_id/30/qty/1000 ' ;
188189
190+ $ buyRequest = $ this ->getMockBuilder (DataObject::class)
191+ ->addMethods (['getSuperAttribute ' , 'getQty ' ])
192+ ->disableOriginalConstructor ()
193+ ->getMock ();
194+ $ buyRequest ->expects ($ this ->once ())
195+ ->method ('getSuperAttribute ' )
196+ ->willReturn (['100 ' => '10 ' ]);
197+ $ buyRequest ->expects ($ this ->exactly (2 ))
198+ ->method ('getQty ' )
199+ ->willReturn ('1000 ' );
200+
189201 /** @var WishlistItem|MockObject $wishlistItem */
190202 $ wishlistItem = $ this ->getMockBuilder (WishlistItem::class)
191203 ->addMethods (['getWishlistItemId ' , 'getProductId ' , 'getQty ' ])
204+ ->onlyMethods (['getBuyRequest ' ])
192205 ->disableOriginalConstructor ()
193206 ->getMock ();
207+ $ wishlistItem
208+ ->expects ($ this ->once ())
209+ ->method ('getBuyRequest ' )
210+ ->willReturn ($ buyRequest );
194211 $ wishlistItem
195212 ->expects ($ this ->once ())
196213 ->method ('getWishlistItemId ' )
@@ -209,7 +226,7 @@ public function testGetConfigureUrl()
209226 ->with ('wishlist/index/configure ' , ['id ' => 4 , 'product_id ' => 30 , 'qty ' => 1000 ])
210227 ->willReturn ($ url );
211228
212- $ this ->assertEquals ($ url , $ this ->model ->getConfigureUrl ($ wishlistItem ));
229+ $ this ->assertEquals ($ url . ' #100=10 ' , $ this ->model ->getConfigureUrl ($ wishlistItem ));
213230 }
214231
215232 public function testGetWishlist ()
0 commit comments