Skip to content

Commit a67c815

Browse files
committed
MAGETWO-52170: Impossible to create Downloadable Product - fix unit
1 parent 8c18808 commit a67c815

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

app/code/Magento/Downloadable/Test/Unit/Model/Link/BuilderTest.php

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,17 @@ public function testBuild($data, $expectedPrice)
9494
$basePath = 'l/e/f/gm';
9595
$baseSamplePath = 's/l/e/f/gm';
9696
$linkFileName = 'cat1.png';
97-
$this->objectCopyServiceMock->expects($this->once())->method('getDataFromFieldset')->with(
98-
'downloadable_data',
99-
'to_link',
100-
$data
97+
$this->objectCopyServiceMock->expects($this->exactly(2))->method('getDataFromFieldset')->withConsecutive(
98+
[
99+
'downloadable_data',
100+
'to_link',
101+
$data
102+
],
103+
[
104+
'downloadable_link_sample_data',
105+
'to_link_sample',
106+
$data['sample']
107+
]
101108
)->willReturn($downloadableData);
102109
$this->service->setData($data);
103110
$this->dataObjectHelperMock->method('populateWithArray')
@@ -165,10 +172,17 @@ public function testBuildFileNotProvided()
165172
]
166173
];
167174
$downloadableData = ['sort_order' => 1];
168-
$this->objectCopyServiceMock->expects($this->once())->method('getDataFromFieldset')->with(
169-
'downloadable_data',
170-
'to_link',
171-
$data
175+
$this->objectCopyServiceMock->expects($this->exactly(2))->method('getDataFromFieldset')->withConsecutive(
176+
[
177+
'downloadable_data',
178+
'to_link',
179+
$data
180+
],
181+
[
182+
'downloadable_link_sample_data',
183+
'to_link_sample',
184+
$data['sample']
185+
]
172186
)->willReturn($downloadableData);
173187
$this->service->setData($data);
174188
$this->dataObjectHelperMock->method('populateWithArray')

0 commit comments

Comments
 (0)