Skip to content

Commit 55daf5f

Browse files
committed
ACP2E-3965: [Mainline] Configurable product with video causes API error
1 parent 6ad3f57 commit 55daf5f

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

app/code/Magento/ConfigurableProduct/Model/LinkManagement.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
/**
2323
* Configurable product link management.
2424
*
25+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2526
*/
2627
class LinkManagement implements LinkManagementInterface
2728
{

app/code/Magento/ConfigurableProduct/Test/Unit/Model/LinkManagementTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,16 @@ public function testGetChildren(): void
130130
$childProduct->expects($this->once())->method('getData')->with('code')->willReturn(10);
131131
$childProduct->expects($this->once())->method('getStoreId')->willReturn(1);
132132
$childProduct->expects($this->once())->method('getAttributes')->willReturn([$attribute]);
133+
$childProduct->expects($this->once())->method('getMediaGalleryEntries')->willReturn([]);
133134

134135
$productMock = $this->getMockForAbstractClass(ProductInterface::class);
136+
$productMock->expects($this->once())->method('setMediaGalleryEntries')->with([])->willReturnSelf();
135137

136138
$this->dataObjectHelperMock->expects($this->once())
137139
->method('populateWithArray')
138140
->with(
139141
$productMock,
140-
['store_id' => 1, 'code' => 10, 'media_gallery_entries' => []],
142+
['store_id' => 1, 'code' => 10],
141143
ProductInterface::class
142144
)->willReturnSelf();
143145

app/code/Magento/ProductVideo/Model/Product/Attribute/Media/ExternalVideoEntryConverter.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ public function __construct(
4949
}
5050

5151
/**
52+
* Return video entry type
53+
*
5254
* @return string
5355
*/
5456
public function getMediaEntryType()
@@ -57,6 +59,8 @@ public function getMediaEntryType()
5759
}
5860

5961
/**
62+
* Convert raw data to media gallery video entry
63+
*
6064
* @param Product $product
6165
* @param array $rowData
6266
* @return ProductAttributeMediaGalleryEntryInterface
@@ -77,7 +81,7 @@ public function convertTo(Product $product, array $rowData)
7781
}
7882

7983
/**
80-
* {@inheritdoc}
84+
* @inheritdoc
8185
*/
8286
public function convertFrom(ProductAttributeMediaGalleryEntryInterface $entry)
8387
{

0 commit comments

Comments
 (0)