File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
app/code/Magento/Downloadable Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -122,6 +122,12 @@ public function build(SampleInterface $sample)
122
122
if (!$ sample ->getSortOrder ()) {
123
123
$ sample ->setSortOrder (1 );
124
124
}
125
+
126
+ $ useDefaultTitle = $ this ->data ['use_default_title ' ] ?? false ;
127
+
128
+ if ($ useDefaultTitle ) {
129
+ $ sample ->setTitle (null );
130
+ }
125
131
$ this ->resetData ();
126
132
127
133
return $ sample ;
Original file line number Diff line number Diff line change @@ -85,6 +85,7 @@ public function testBuild()
85
85
{
86
86
$ data = [
87
87
'file ' => 'cXVlIHRhbA== ' ,
88
+ 'use_default_title ' => '1 ' ,
88
89
'type ' => 'file '
89
90
];
90
91
$ downloadableData = ['sort_order ' => 1 ];
@@ -123,6 +124,10 @@ public function testBuild()
123
124
)->willReturn ($ fileName );
124
125
$ this ->sampleMock ->expects ($ this ->once ())->method ('setSampleFile ' )->with ($ fileName );
125
126
$ this ->sampleMock ->expects ($ this ->once ())->method ('setSortOrder ' )->with (1 );
127
+ $ useDefaultTitle = $ data ['use_default_title ' ] ?? false ;
128
+ if ($ useDefaultTitle ) {
129
+ $ this ->sampleMock ->expects ($ this ->once ())->method ('setTitle ' )->with (null );
130
+ }
126
131
$ this ->service ->setData ($ data );
127
132
128
133
$ this ->service ->build ($ this ->sampleMock );
You can’t perform that action at this time.
0 commit comments