Skip to content

Commit 525308c

Browse files
committed
MAGETWO-8709: [GITHUB] Child product image should be shown in Wishist if options are selected for configurable product #8168
- fixing formatting
1 parent c2c8ef9 commit 525308c

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

app/code/Magento/Catalog/Model/Product/Configuration/Item/ItemResolverComposite.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ public function __construct(array $itemResolvers)
3434
*/
3535
public function getFinalProduct(ItemInterface $item) : ProductInterface
3636
{
37-
$product = $item->getProduct();
37+
$finalProduct = $item->getProduct();
3838
foreach ($this->itemResolvers as $resolver) {
3939
$resolvedProduct = $this->getItemResolverInstance($resolver)->getFinalProduct($item);
40-
if ($resolvedProduct !== $product) {
41-
$product = $resolvedProduct;
40+
if ($resolvedProduct !== $finalProduct) {
41+
$finalProduct = $resolvedProduct;
4242
break;
4343
}
4444
}
45-
return $product;
45+
return $finalProduct;
4646
}
4747

4848
/**
@@ -51,7 +51,7 @@ public function getFinalProduct(ItemInterface $item) : ProductInterface
5151
* @param string $className
5252
* @return ItemResolverInterface
5353
*/
54-
private function getItemResolverInstance(string $className)
54+
private function getItemResolverInstance(string $className) : ItemResolverInterface
5555
{
5656
if (!isset($this->itemResolversInstances[$className])) {
5757
$this->itemResolversInstances[$className] = ObjectManager::getInstance()->get($className);

app/code/Magento/Checkout/Model/Cart/ImageProvider.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ class ImageProvider
2020

2121
/**
2222
* @var \Magento\Checkout\CustomerData\ItemPoolInterface
23-
* @deprecated
23+
* @deprecated No need for the pool as images are resolved in the default item implementation
24+
* @see \Magento\Checkout\CustomerData\DefaultItem::getProductForThumbnail
2425
*/
2526
protected $itemPool;
2627

app/code/Magento/Checkout/Test/Unit/Block/Cart/Item/RendererTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,16 @@ protected function _initProduct()
8686
Product::class,
8787
['getName', '__wakeup', 'getIdentities']
8888
);
89-
$product->expects($this->any())->method('getName')->will($this->returnValue('Parent Product'));
89+
$product->expects($this->any())->method('getName')->willReturn('Parent Product');
9090

9191
/** @var Item|\PHPUnit_Framework_MockObject_MockObject $item */
9292
$item = $this->createMock(\Magento\Quote\Model\Quote\Item::class);
93-
$item->expects($this->any())->method('getProduct')->will($this->returnValue($product));
93+
$item->expects($this->any())->method('getProduct')->willReturn($product);
9494

9595
$this->itemResolver->expects($this->any())
9696
->method('getFinalProduct')
9797
->with($item)
98-
->will($this->returnValue($product));
98+
->willReturn($product);
9999

100100
$this->renderer->setItem($item);
101101
return $product;
@@ -107,7 +107,7 @@ public function testGetIdentities()
107107
$identities = [1 => 1, 2 => 2, 3 => 3];
108108
$product->expects($this->exactly(2))
109109
->method('getIdentities')
110-
->will($this->returnValue($identities));
110+
->willReturn($identities);
111111

112112
$this->assertEquals($product->getIdentities(), $this->renderer->getIdentities());
113113
}
@@ -135,7 +135,7 @@ public function testGetProductPriceHtml()
135135
$this->layout->expects($this->atLeastOnce())
136136
->method('getBlock')
137137
->with('product.price.render.default')
138-
->will($this->returnValue($priceRender));
138+
->willReturn($priceRender);
139139

140140
$priceRender->expects($this->once())
141141
->method('render')
@@ -147,7 +147,7 @@ public function testGetProductPriceHtml()
147147
'display_minimal_price' => true,
148148
'zone' => \Magento\Framework\Pricing\Render::ZONE_ITEM_LIST
149149
]
150-
)->will($this->returnValue($priceHtml));
150+
)->willReturn($priceHtml);
151151

152152
$this->assertEquals($priceHtml, $this->renderer->getProductPriceHtml($product));
153153
}

0 commit comments

Comments
 (0)