Skip to content

Commit 7ce21ef

Browse files
committed
MAGETWO-52836: Enable EAV attributes caching
1 parent 3fd459d commit 7ce21ef

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

app/code/Magento/Eav/Model/Entity/AttributeCache.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ public function saveAttributes($entityType, $attributes, $suffix = '')
119119
$cacheKey,
120120
[
121121
\Magento\Eav\Model\Cache\Type::CACHE_TAG,
122-
\Magento\Eav\Model\Entity\Attribute::CACHE_TAG
122+
\Magento\Eav\Model\Entity\Attribute::CACHE_TAG,
123+
\Magento\Framework\App\Config\ScopePool::CACHE_TAG
123124
]
124125
);
125126
}

dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/EavTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ protected function setUp()
6060
*/
6161
public function testModifyMeta()
6262
{
63+
$this->objectManager->get(\Magento\Eav\Model\Entity\AttributeCache::class)->clear();
6364
/** @var \Magento\Catalog\Model\Product $product */
6465
$product = $this->objectManager->create(\Magento\Catalog\Model\Product::class);
6566
$product->load(1);
@@ -79,9 +80,9 @@ public function testModifyData()
7980
$product = $this->objectManager->create(\Magento\Catalog\Model\Product::class);
8081
$product->load(1);
8182
$this->locatorMock->expects($this->any())->method('getProduct')->willReturn($product);
82-
8383
$expectedData = include __DIR__ . '/_files/eav_expected_data_output.php';
84-
$this->objectManager->create(\Magento\Eav\Model\Entity\AttributeCache::class)->clear();
84+
85+
8586
$actualData = $this->eavModifier->modifyData([]);
8687
$this->prepareDataForComparison($actualData, $expectedData);
8788
$this->assertEquals($expectedData, $actualData);

dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/_files/eav_expected_meta_output.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@
118118
"required" => "1",
119119
"label" => "Price",
120120
"source" => "product-details",
121-
"scopeLabel" => "[WEBSITE]",
122-
"globalScope" => false,
121+
"scopeLabel" => "[GLOBAL]",
122+
"globalScope" => true,
123123
"code" => "price",
124124
"sortOrder" => "__placeholder__",
125125
"componentType" => "field",

0 commit comments

Comments
 (0)