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)
122122 if (!$ sample ->getSortOrder ()) {
123123 $ sample ->setSortOrder (1 );
124124 }
125+
126+ $ useDefaultTitle = $ this ->data ['use_default_title ' ] ?? false ;
127+
128+ if ($ useDefaultTitle ) {
129+ $ sample ->setTitle (null );
130+ }
125131 $ this ->resetData ();
126132
127133 return $ sample ;
Original file line number Diff line number Diff line change @@ -85,6 +85,7 @@ public function testBuild()
8585 {
8686 $ data = [
8787 'file ' => 'cXVlIHRhbA== ' ,
88+ 'use_default_title ' => '1 ' ,
8889 'type ' => 'file '
8990 ];
9091 $ downloadableData = ['sort_order ' => 1 ];
@@ -123,6 +124,10 @@ public function testBuild()
123124 )->willReturn ($ fileName );
124125 $ this ->sampleMock ->expects ($ this ->once ())->method ('setSampleFile ' )->with ($ fileName );
125126 $ 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+ }
126131 $ this ->service ->setData ($ data );
127132
128133 $ this ->service ->build ($ this ->sampleMock );
You can’t perform that action at this time.
0 commit comments