File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
dev/tests/integration/testsuite/Magento/ImportExport/Controller/Adminhtml/Export/File Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ protected function setUp(): void
6565 $ this ->backendUrl ->turnOnSecretKey ();
6666 $ this ->sourceFilePath = __DIR__ . '/../../Import/_files ' . DIRECTORY_SEPARATOR . $ this ->fileName ;
6767 //Refers to tests 'var' directory
68- $ this ->varDirectory = $ this ->fileSystem ->getDirectoryRead (DirectoryList::VAR_DIR );
68+ $ this ->varDirectory = $ this ->fileSystem ->getDirectoryWrite (DirectoryList::VAR_IMPORT_EXPORT );
6969 }
7070
7171 /**
@@ -124,9 +124,11 @@ public function testExecute($file): void
124124 */
125125 private function copyFile ($ destinationFilePath ): void
126126 {
127- //Refers to application root directory
128- $ rootDirectory = $ this ->fileSystem ->getDirectoryWrite (DirectoryList::ROOT );
129- $ rootDirectory ->copyFile ($ this ->sourceFilePath , $ this ->varDirectory ->getAbsolutePath ($ destinationFilePath ));
127+ $ driver = $ this ->varDirectory ->getDriver ();
128+ $ absolutePath = $ this ->varDirectory ->getAbsolutePath ($ destinationFilePath );
129+
130+ $ driver ->createDirectory (dirname ($ absolutePath ));
131+ $ driver ->filePutContents ($ absolutePath , file_get_contents ($ this ->sourceFilePath ));
130132 }
131133
132134 /**
You can’t perform that action at this time.
0 commit comments