Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/code/Magento/Wishlist/CustomerData/Wishlist.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ protected function getItemData(\Magento\Wishlist\Model\Item $wishlistItem)
$product = $wishlistItem->getProduct();
return [
'image' => $this->getImageData($product),
'product_sku' => $product->getSku(),
'product_id' => $product->getId(),
'product_url' => $this->wishlistHelper->getProductUrl($wishlistItem),
'product_name' => $product->getName(),
'product_price' => $this->block->getProductPriceHtml(
Expand Down
24 changes: 24 additions & 0 deletions app/code/Magento/Wishlist/Test/Unit/CustomerData/WishlistTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ public function testGetSectionData()
$imageLabel = 'image_label';
$imageWidth = 'image_width';
$imageHeight = 'image_height';
$productSku = 'product_sku';
$productId = 'product_id';
$productUrl = 'product_url';
$productName = 'product_name';
$productPrice = 'product_price';
Expand All @@ -97,6 +99,8 @@ public function testGetSectionData()
'width' => $imageWidth,
'height' => $imageHeight,
],
'product_sku' => $productSku,
'product_id' => $productId,
'product_url' => $productUrl,
'product_name' => $productName,
'product_price' => $productPrice,
Expand Down Expand Up @@ -186,6 +190,12 @@ public function testGetSectionData()
->with($itemMock, [])
->willReturn($productUrl);

$productMock->expects($this->once())
->method('getSku')
->willReturn($productSku);
$productMock->expects($this->once())
->method('getId')
->willReturn($productId);
$productMock->expects($this->once())
->method('getName')
->willReturn($productName);
Expand Down Expand Up @@ -246,6 +256,8 @@ public function testGetSectionDataWithTwoItems()
$imageLabel = 'image_label';
$imageWidth = 'image_width';
$imageHeight = 'image_height';
$productSku = 'product_sku';
$productId = 'product_id';
$productUrl = 'product_url';
$productName = 'product_name';
$productPrice = 'product_price';
Expand All @@ -272,6 +284,8 @@ public function testGetSectionDataWithTwoItems()
'width' => $imageWidth,
'height' => $imageHeight,
],
'product_sku' => $productSku,
'product_id' => $productId,
'product_url' => $productUrl,
'product_name' => $productName,
'product_price' => $productPrice,
Expand All @@ -288,6 +302,8 @@ public function testGetSectionDataWithTwoItems()
'width' => $imageWidth,
'height' => $imageHeight,
],
'product_sku' => $productSku,
'product_id' => $productId,
'product_url' => $productUrl,
'product_name' => $productName,
'product_price' => $productPrice,
Expand Down Expand Up @@ -375,6 +391,14 @@ public function testGetSectionDataWithTwoItems()
->method('getName')
->willReturn($productName);

$productMock->expects($this->exactly(2))
->method('getId')
->willReturn($productId);

$productMock->expects($this->exactly(2))
->method('getSku')
->willReturn($productSku);

$this->sidebarMock->expects($this->exactly(2))
->method('getProductPriceHtml')
->with(
Expand Down