Skip to content

Commit 7962557

Browse files
committed
Fix the error that is wrong link title of a downloadable product when enabling "Use Default Value"
- Update unit test
1 parent 2a2b98a commit 7962557

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ public function testBuild($data, $expectedPrice)
160160
if (isset($data['is_unlimited'])) {
161161
$this->linkMock->expects($this->once())->method('setNumberOfDownloads')->with(0);
162162
}
163-
if (isset($data['use_default_title']) && $data['use_default_title'] == '1') {
163+
$useDefaultTitle = $data['use_default_title'] ?? false;
164+
if ($useDefaultTitle) {
164165
$this->linkMock->expects($this->once())->method('setTitle')->with(null);
165166
}
166167
if (isset($data['price'])) {

0 commit comments

Comments
 (0)