@@ -112,13 +112,23 @@ protected function setUp(): void
112112 );
113113 }
114114
115+ /**
116+ * Return unique identifier for an instance.
117+ *
118+ * @return string
119+ */
120+ private function getInstanceIdentifier ()
121+ {
122+ return hash ('sha256 ' , BP );
123+ }
124+
115125 /**
116126 * @param bool $isArchiveSourceDirectory
117127 * @dataProvider prepareExportDataDataProvider
118128 */
119129 public function testPrepareExportData ($ isArchiveSourceDirectory )
120130 {
121- $ tmpFilesDirectoryPath = $ this ->subdirectoryPath . 'tmp/ ' ;
131+ $ tmpFilesDirectoryPath = $ this ->subdirectoryPath . 'tmp/ ' . $ this -> getInstanceIdentifier () . ' / ' ;
122132 $ archiveRelativePath = $ this ->subdirectoryPath . $ this ->archiveName ;
123133
124134 $ archiveSource = $ isArchiveSourceDirectory ? (__DIR__ ) : '/tmp/ ' . $ tmpFilesDirectoryPath ;
@@ -127,7 +137,7 @@ public function testPrepareExportData($isArchiveSourceDirectory)
127137 $ this ->filesystemMock
128138 ->expects ($ this ->once ())
129139 ->method ('getDirectoryWrite ' )
130- ->with (DirectoryList::TMP )
140+ ->with (DirectoryList::SYS_TMP )
131141 ->willReturn ($ this ->directoryMock );
132142 $ this ->directoryMock
133143 ->expects ($ this ->exactly (4 ))
@@ -210,13 +220,13 @@ public static function prepareExportDataDataProvider()
210220 public function testPrepareExportDataWithLocalizedException ()
211221 {
212222 $ this ->expectException ('Magento\Framework\Exception\LocalizedException ' );
213- $ tmpFilesDirectoryPath = $ this ->subdirectoryPath . 'tmp/ ' ;
223+ $ tmpFilesDirectoryPath = $ this ->subdirectoryPath . 'tmp/ ' . $ this -> getInstanceIdentifier () . ' / ' ;
214224 $ archivePath = $ this ->subdirectoryPath . $ this ->archiveName ;
215225
216226 $ this ->filesystemMock
217227 ->expects ($ this ->once ())
218228 ->method ('getDirectoryWrite ' )
219- ->with (DirectoryList::TMP )
229+ ->with (DirectoryList::SYS_TMP )
220230 ->willReturn ($ this ->directoryMock );
221231 $ this ->reportWriterMock
222232 ->expects ($ this ->once ())
0 commit comments