File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
app/code/Magento/CatalogImportExport Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -170,9 +170,15 @@ public function move($fileName, $renameFileOff = false)
170
170
}
171
171
}
172
172
173
+ if ($ this ->getTmpDir ()) {
174
+ $ filePath = $ this ->getTmpDir () . '/ ' ;
175
+ } else {
176
+ $ filePath = '' ;
177
+ }
173
178
$ fileName = preg_replace ('/[^a-z0-9\._-]+/i ' , '' , $ fileName );
179
+ $ filePath = $ this ->_directory ->getRelativePath ($ filePath . $ fileName );
174
180
$ this ->_directory ->writeFile (
175
- $ this -> _directory -> getRelativePath ( $ this -> getTmpDir () . ' / ' . $ fileName ) ,
181
+ $ filePath ,
176
182
$ read ->readAll ()
177
183
);
178
184
}
Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ protected function setUp()
103
103
public function testMoveFileUrl ($ fileUrl , $ expectedHost , $ expectedFileName )
104
104
{
105
105
$ destDir = 'var/dest/dir ' ;
106
- $ expectedRelativeFilePath = $ this -> uploader -> getTmpDir () . ' / ' . $ expectedFileName ;
106
+ $ expectedRelativeFilePath = $ expectedFileName ;
107
107
$ this ->directoryMock ->expects ($ this ->once ())->method ('isWritable ' )->with ($ destDir )->willReturn (true );
108
108
$ this ->directoryMock ->expects ($ this ->any ())->method ('getRelativePath ' )->with ($ expectedRelativeFilePath );
109
109
$ this ->directoryMock ->expects ($ this ->once ())->method ('getAbsolutePath ' )->with ($ destDir )
@@ -139,7 +139,7 @@ public function testMoveFileName()
139
139
{
140
140
$ destDir = 'var/dest/dir ' ;
141
141
$ fileName = 'test_uploader_file ' ;
142
- $ expectedRelativeFilePath = $ this -> uploader -> getTmpDir () . ' / ' . $ fileName ;
142
+ $ expectedRelativeFilePath = $ fileName ;
143
143
$ this ->directoryMock ->expects ($ this ->once ())->method ('isWritable ' )->with ($ destDir )->willReturn (true );
144
144
$ this ->directoryMock ->expects ($ this ->any ())->method ('getRelativePath ' )->with ($ expectedRelativeFilePath );
145
145
$ this ->directoryMock ->expects ($ this ->once ())->method ('getAbsolutePath ' )->with ($ destDir )
You can’t perform that action at this time.
0 commit comments