Skip to content

Commit 438d0c8

Browse files
committed
B2B-2017: [AWS S3] [Integration Tests]: Investigate Test Failures in ImportExport module
1 parent 5cfa451 commit 438d0c8

File tree

1 file changed

+6
-4
lines changed
  • dev/tests/integration/testsuite/Magento/ImportExport/Controller/Adminhtml/Export/File

1 file changed

+6
-4
lines changed

dev/tests/integration/testsuite/Magento/ImportExport/Controller/Adminhtml/Export/File/DownloadTest.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff 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
/**

0 commit comments

Comments
 (0)