File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
app/code/Magento/Downloadable Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ public function build(\Magento\Downloadable\Api\Data\LinkInterface $link)
116
116
$ link ->setLinkFile ($ linkFileName );
117
117
$ link ->setLinkUrl (null );
118
118
}
119
-
119
+
120
120
if (isset ($ this ->data ['sample ' ])) {
121
121
$ link = $ this ->buildSample ($ link , $ this ->data ['sample ' ]);
122
122
}
@@ -132,6 +132,10 @@ public function build(\Magento\Downloadable\Api\Data\LinkInterface $link)
132
132
if (isset ($ this ->data ['is_unlimited ' ]) && $ this ->data ['is_unlimited ' ]) {
133
133
$ link ->setNumberOfDownloads (0 );
134
134
}
135
+
136
+ if (isset ($ this ->data ['use_default_title ' ]) && $ this ->data ['use_default_title ' ] == '1 ' ) {
137
+ $ link ->setTitle (null );
138
+ }
135
139
$ this ->resetData ();
136
140
137
141
return $ link ;
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ protected function setUp()
68
68
$ this ->linkMock = $ this ->getMockBuilder (LinkInterface::class)
69
69
->disableOriginalConstructor ()
70
70
->getMockForAbstractClass ();
71
-
71
+
72
72
$ this ->service = $ objectManagerHelper ->getObject (
73
73
Builder::class,
74
74
[
@@ -160,6 +160,9 @@ public function testBuild($data, $expectedPrice)
160
160
if (isset ($ data ['is_unlimited ' ])) {
161
161
$ this ->linkMock ->expects ($ this ->once ())->method ('setNumberOfDownloads ' )->with (0 );
162
162
}
163
+ if (isset ($ data ['use_default_title ' ]) && $ data ['use_default_title ' ] == '1 ' ) {
164
+ $ this ->linkMock ->expects ($ this ->once ())->method ('getTitle ' )->with (null );
165
+ }
163
166
if (isset ($ data ['price ' ])) {
164
167
$ this ->linkMock ->expects ($ this ->once ())->method ('getPrice ' )->willReturn ($ data ['price ' ]);
165
168
} else {
You can’t perform that action at this time.
0 commit comments