Skip to content

Commit 9c47fba

Browse files
committed
MC-21882: Product url_key not updating on duplicating
- Fix static
1 parent 9f5c8ad commit 9c47fba

File tree

2 files changed

+22
-11
lines changed

2 files changed

+22
-11
lines changed

app/code/Magento/Catalog/Model/Attribute/ScopeOverriddenValue.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ public function getDefaultValues($entityType, $entity)
110110
}
111111

112112
/**
113+
* Init attribute values.
114+
*
113115
* @param string $entityType
114116
* @param \Magento\Catalog\Model\AbstractModel $entity
115117
* @param int $storeId
@@ -158,6 +160,8 @@ private function initAttributeValues($entityType, $entity, $storeId)
158160
}
159161

160162
/**
163+
* Returns entity attributes.
164+
*
161165
* @param string $entityType
162166
* @return \Magento\Eav\Api\Data\AttributeInterface[]
163167
*/

app/code/Magento/Catalog/Test/Unit/Model/Product/CopierTest.php

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,13 @@ protected function setUp()
8181
$this->scopeOverriddenValue
8282
);
8383

84-
$this->setProperties($this->_model, [
85-
'optionRepository' => $this->optionRepositoryMock,
86-
'metadataPool' => $metadataPool,
87-
]);
84+
$this->setProperties(
85+
$this->_model,
86+
[
87+
'optionRepository' => $this->optionRepositoryMock,
88+
'metadataPool' => $metadataPool,
89+
]
90+
);
8891
}
8992

9093
/**
@@ -112,10 +115,12 @@ public function testCopy()
112115
];
113116
$this->productMock->expects($this->atLeastOnce())->method('getWebsiteIds');
114117
$this->productMock->expects($this->atLeastOnce())->method('getCategoryIds');
115-
$this->productMock->expects($this->any())->method('getData')->willReturnMap([
116-
['', null, $productData],
117-
['linkField', null, '1'],
118-
]);
118+
$this->productMock->expects($this->any())->method('getData')->willReturnMap(
119+
[
120+
['', null, $productData],
121+
['linkField', null, '1'],
122+
]
123+
);
119124

120125
$entityMock = $this->getMockForAbstractClass(
121126
\Magento\Eav\Model\Entity\AbstractEntity::class,
@@ -200,9 +205,11 @@ public function testCopy()
200205

201206
$this->metadata->expects($this->any())->method('getLinkField')->willReturn('linkField');
202207

203-
$duplicateMock->expects($this->any())->method('getData')->willReturnMap([
204-
['linkField', null, '2'],
205-
]);
208+
$duplicateMock->expects($this->any())->method('getData')->willReturnMap(
209+
[
210+
['linkField', null, '2'],
211+
]
212+
);
206213
$this->optionRepositoryMock->expects($this->once())
207214
->method('duplicate')
208215
->with($this->productMock, $duplicateMock);

0 commit comments

Comments
 (0)