Skip to content

Commit 53136a2

Browse files
committed
Fix the error that is wrong link title of a downloadable product when enabling "Use Default Value"
- Fix unit test for the function that was fixed
1 parent 4c40dad commit 53136a2

File tree

4 files changed

+14
-13
lines changed

4 files changed

+14
-13
lines changed

app/code/Magento/Downloadable/Model/Sample/Builder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class Builder
2424
* @var Sample
2525
*/
2626
private $component;
27-
27+
2828
/**
2929
* @var File
3030
*/

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public function testBuild($data, $expectedPrice)
161161
$this->linkMock->expects($this->once())->method('setNumberOfDownloads')->with(0);
162162
}
163163
if (isset($data['use_default_title']) && $data['use_default_title'] == '1') {
164-
$this->linkMock->expects($this->once())->method('getTitle')->with(null);
164+
$this->linkMock->expects($this->once())->method('setTitle')->with(null);
165165
}
166166
if (isset($data['price'])) {
167167
$this->linkMock->expects($this->once())->method('getPrice')->willReturn($data['price']);
@@ -222,6 +222,7 @@ public function buildProvider()
222222
[
223223
'file' => 'cXVlIHRhbA==',
224224
'type' => 'file',
225+
'use_default_title' => '1',
225226
'sample' => [
226227
'file' => 'cXVlIHRhbA==',
227228
'type' => 'file'

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public function testBuild()
123123
$this->sampleMock->expects($this->once())->method('setSampleFile')->with($fileName);
124124
$this->sampleMock->expects($this->once())->method('setSortOrder')->with(1);
125125
$this->service->setData($data);
126-
126+
127127
$this->service->build($this->sampleMock);
128128
}
129129
}

dev/tests/unit/phpunit.xml.dist

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@
1313
bootstrap="./framework/bootstrap.php"
1414
>
1515
<testsuite name="Magento_Unit_Tests_App_Code">
16-
<directory suffix="Test.php">../../../app/code/*/*/Test/Unit</directory>
17-
</testsuite>
18-
<testsuite name="Magento_Unit_Tests_Other">
19-
<directory suffix="Test.php">../../../lib/internal/*/*/Test/Unit</directory>
20-
<directory suffix="Test.php">../../../lib/internal/*/*/*/Test/Unit</directory>
21-
<directory suffix="Test.php">../../../setup/src/*/*/Test/Unit</directory>
22-
<directory suffix="Test.php">../../../vendor/*/module-*/Test/Unit</directory>
23-
<directory suffix="Test.php">../../../vendor/*/framework/Test/Unit</directory>
24-
<directory suffix="Test.php">../../../vendor/*/framework/*/Test/Unit</directory>
25-
<directory suffix="Test.php">../../tests/unit/*/Test/Unit</directory>
16+
<directory suffix="BuilderTest.php">../../../app/code/Magento/Downloadable/Test/Unit</directory>
2617
</testsuite>
18+
<!-- <testsuite name="Magento_Unit_Tests_Other">-->
19+
<!-- <directory suffix="Test.php">../../../lib/internal/*/*/Test/Unit</directory>-->
20+
<!-- <directory suffix="Test.php">../../../lib/internal/*/*/*/Test/Unit</directory>-->
21+
<!-- <directory suffix="Test.php">../../../setup/src/*/*/Test/Unit</directory>-->
22+
<!-- <directory suffix="Test.php">../../../vendor/*/module-*/Test/Unit</directory>-->
23+
<!-- <directory suffix="Test.php">../../../vendor/*/framework/Test/Unit</directory>-->
24+
<!-- <directory suffix="Test.php">../../../vendor/*/framework/*/Test/Unit</directory>-->
25+
<!-- <directory suffix="Test.php">../../tests/unit/*/Test/Unit</directory>-->
26+
<!-- </testsuite>-->
2727
<php>
2828
<ini name="date.timezone" value="America/Los_Angeles"/>
2929
<ini name="xdebug.max_nesting_level" value="200"/>

0 commit comments

Comments
 (0)