File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
dev/tests/integration/testsuite/Magento/ImportExport
Controller/Adminhtml/Export/File Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ protected function setUp(): void
65
65
$ this ->backendUrl ->turnOnSecretKey ();
66
66
$ this ->sourceFilePath = __DIR__ . '/../../Import/_files ' . DIRECTORY_SEPARATOR . $ this ->fileName ;
67
67
//Refers to tests 'var' directory
68
- $ this ->varDirectory = $ this ->fileSystem ->getDirectoryRead (DirectoryList::VAR_DIR );
68
+ $ this ->varDirectory = $ this ->fileSystem ->getDirectoryWrite (DirectoryList::VAR_IMPORT_EXPORT );
69
69
}
70
70
71
71
/**
@@ -124,9 +124,11 @@ public function testExecute($file): void
124
124
*/
125
125
private function copyFile ($ destinationFilePath ): void
126
126
{
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 ));
130
132
}
131
133
132
134
/**
Original file line number Diff line number Diff line change @@ -124,7 +124,7 @@ private function getSkuPosition(array $csvFileData): ?int
124
124
private function getCsvData (string $ filePath ): array
125
125
{
126
126
$ driver = $ this ->directory ->getDriver ();
127
- $ fileResource = $ driver ->fileOpen ($ filePath , null );
127
+ $ fileResource = $ driver ->fileOpen ($ filePath , ' r ' );
128
128
129
129
$ data = [];
130
130
while ($ rowData = $ driver ->fileGetCsv ($ fileResource , 100000 )) {
You can’t perform that action at this time.
0 commit comments