Skip to content

Commit 0e3b417

Browse files
author
Sergey Shvets
committed
MAGETWO-61039: Error when saving an existing product with an image
fixed unit-test
1 parent 8d40cd8 commit 0e3b417

File tree

1 file changed

+6
-4
lines changed
  • app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier

1 file changed

+6
-4
lines changed

app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/ImagesTest.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,16 @@ class ImagesTest extends AbstractModifierTest
1717
*/
1818
protected function createModel()
1919
{
20-
$this->productMock->expects($this->once())->method('getId')->willReturn(2051);
21-
$actualResult = $this->getModel()->modifyData($this->getSampleData());
22-
$this->assertSame('', $actualResult[2051]['product']['media_gallery']['images'][0]['label']);
20+
return $this->objectManager->getObject(Images::class, [
21+
'locator' => $this->locatorMock,
22+
]);
2323
}
2424

2525
public function testModifyData()
2626
{
27-
$this->assertSame($this->getSampleData(), $this->getModel()->modifyData($this->getSampleData()));
27+
$this->productMock->expects($this->once())->method('getId')->willReturn(2051);
28+
$actualResult = $this->getModel()->modifyData($this->getSampleData());
29+
$this->assertSame('', $actualResult[2051]['product']['media_gallery']['images'][0]['label']);
2830
}
2931

3032
public function testModifyMeta()

0 commit comments

Comments
 (0)