Skip to content

Commit

Permalink
Fix the error that is wrong link title of a downloadable product when…
Browse files Browse the repository at this point in the history
… enabling "Use Default Value"

- Fix unit test for the function that was fixed
  • Loading branch information
tna274 committed Mar 16, 2020
1 parent 4c40dad commit 53136a2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion app/code/Magento/Downloadable/Model/Sample/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Builder
* @var Sample
*/
private $component;

/**
* @var File
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public function testBuild($data, $expectedPrice)
$this->linkMock->expects($this->once())->method('setNumberOfDownloads')->with(0);
}
if (isset($data['use_default_title']) && $data['use_default_title'] == '1') {
$this->linkMock->expects($this->once())->method('getTitle')->with(null);
$this->linkMock->expects($this->once())->method('setTitle')->with(null);
}
if (isset($data['price'])) {
$this->linkMock->expects($this->once())->method('getPrice')->willReturn($data['price']);
Expand Down Expand Up @@ -222,6 +222,7 @@ public function buildProvider()
[
'file' => 'cXVlIHRhbA==',
'type' => 'file',
'use_default_title' => '1',
'sample' => [
'file' => 'cXVlIHRhbA==',
'type' => 'file'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public function testBuild()
$this->sampleMock->expects($this->once())->method('setSampleFile')->with($fileName);
$this->sampleMock->expects($this->once())->method('setSortOrder')->with(1);
$this->service->setData($data);

$this->service->build($this->sampleMock);
}
}
20 changes: 10 additions & 10 deletions dev/tests/unit/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@
bootstrap="./framework/bootstrap.php"
>
<testsuite name="Magento_Unit_Tests_App_Code">
<directory suffix="Test.php">../../../app/code/*/*/Test/Unit</directory>
</testsuite>
<testsuite name="Magento_Unit_Tests_Other">
<directory suffix="Test.php">../../../lib/internal/*/*/Test/Unit</directory>
<directory suffix="Test.php">../../../lib/internal/*/*/*/Test/Unit</directory>
<directory suffix="Test.php">../../../setup/src/*/*/Test/Unit</directory>
<directory suffix="Test.php">../../../vendor/*/module-*/Test/Unit</directory>
<directory suffix="Test.php">../../../vendor/*/framework/Test/Unit</directory>
<directory suffix="Test.php">../../../vendor/*/framework/*/Test/Unit</directory>
<directory suffix="Test.php">../../tests/unit/*/Test/Unit</directory>
<directory suffix="BuilderTest.php">../../../app/code/Magento/Downloadable/Test/Unit</directory>
</testsuite>
<!-- <testsuite name="Magento_Unit_Tests_Other">-->
<!-- <directory suffix="Test.php">../../../lib/internal/*/*/Test/Unit</directory>-->
<!-- <directory suffix="Test.php">../../../lib/internal/*/*/*/Test/Unit</directory>-->
<!-- <directory suffix="Test.php">../../../setup/src/*/*/Test/Unit</directory>-->
<!-- <directory suffix="Test.php">../../../vendor/*/module-*/Test/Unit</directory>-->
<!-- <directory suffix="Test.php">../../../vendor/*/framework/Test/Unit</directory>-->
<!-- <directory suffix="Test.php">../../../vendor/*/framework/*/Test/Unit</directory>-->
<!-- <directory suffix="Test.php">../../tests/unit/*/Test/Unit</directory>-->
<!-- </testsuite>-->
<php>
<ini name="date.timezone" value="America/Los_Angeles"/>
<ini name="xdebug.max_nesting_level" value="200"/>
Expand Down

0 comments on commit 53136a2

Please sign in to comment.