Skip to content

Commit f270f29

Browse files
committed
Merge remote-tracking branch 'tango/MAGETWO-98801' into PR-05
2 parents 702166c + 70d5715 commit f270f29

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

app/code/Magento/Catalog/Block/Product/View.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,7 @@ public function getAddToCartUrl($product, $additional = [])
169169
}
170170

171171
/**
172-
* Get JSON encoded configuration array which can be used for JS dynamic
173-
* price calculation depending on product options
172+
* Get JSON encoded configuration which can be used for JS dynamic price calculation depending on product options
174173
*
175174
* @return string
176175
*/
@@ -262,6 +261,7 @@ public function isStartCustomization()
262261

263262
/**
264263
* Get default qty - either as preconfigured, or as 1.
264+
*
265265
* Also restricts it by minimal qty.
266266
*
267267
* @param null|\Magento\Catalog\Model\Product $product
@@ -323,10 +323,7 @@ public function getQuantityValidators()
323323
public function getIdentities()
324324
{
325325
$identities = $this->getProduct()->getIdentities();
326-
$category = $this->_coreRegistry->registry('current_category');
327-
if ($category) {
328-
$identities[] = Category::CACHE_TAG . '_' . $category->getId();
329-
}
326+
330327
return $identities;
331328
}
332329

app/code/Magento/Catalog/Test/Unit/Block/Product/ViewTest.php

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
namespace Magento\Catalog\Test\Unit\Block\Product;
1010

11+
/**
12+
* Class ViewTest
13+
*/
1114
class ViewTest extends \PHPUnit\Framework\TestCase
1215
{
1316
/**
@@ -25,6 +28,9 @@ class ViewTest extends \PHPUnit\Framework\TestCase
2528
*/
2629
protected $registryMock;
2730

31+
/**
32+
* @inheritDoc
33+
*/
2834
protected function setUp()
2935
{
3036
$helper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
@@ -36,6 +42,9 @@ protected function setUp()
3642
);
3743
}
3844

45+
/**
46+
* @return void
47+
*/
3948
public function testShouldRenderQuantity()
4049
{
4150
$productMock = $this->createMock(\Magento\Catalog\Model\Product::class);
@@ -61,28 +70,26 @@ public function testShouldRenderQuantity()
6170
$this->assertEquals(false, $this->view->shouldRenderQuantity());
6271
}
6372

73+
/**
74+
* @return void
75+
*/
6476
public function testGetIdentities()
6577
{
6678
$productTags = ['cat_p_1'];
6779
$product = $this->createMock(\Magento\Catalog\Model\Product::class);
68-
$category = $this->createMock(\Magento\Catalog\Model\Category::class);
6980

7081
$product->expects($this->once())
7182
->method('getIdentities')
7283
->will($this->returnValue($productTags));
73-
$category->expects($this->once())
74-
->method('getId')
75-
->will($this->returnValue(1));
7684
$this->registryMock->expects($this->any())
7785
->method('registry')
7886
->will(
7987
$this->returnValueMap(
8088
[
8189
['product', $product],
82-
['current_category', $category],
8390
]
8491
)
8592
);
86-
$this->assertEquals(['cat_p_1', 'cat_c_1'], $this->view->getIdentities());
93+
$this->assertEquals($productTags, $this->view->getIdentities());
8794
}
8895
}

0 commit comments

Comments
 (0)