@@ -112,13 +112,23 @@ protected function setUp(): void
112
112
);
113
113
}
114
114
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
+
115
125
/**
116
126
* @param bool $isArchiveSourceDirectory
117
127
* @dataProvider prepareExportDataDataProvider
118
128
*/
119
129
public function testPrepareExportData ($ isArchiveSourceDirectory )
120
130
{
121
- $ tmpFilesDirectoryPath = $ this ->subdirectoryPath . 'tmp/ ' ;
131
+ $ tmpFilesDirectoryPath = $ this ->subdirectoryPath . 'tmp/ ' . $ this -> getInstanceIdentifier () . ' / ' ;
122
132
$ archiveRelativePath = $ this ->subdirectoryPath . $ this ->archiveName ;
123
133
124
134
$ archiveSource = $ isArchiveSourceDirectory ? (__DIR__ ) : '/tmp/ ' . $ tmpFilesDirectoryPath ;
@@ -127,7 +137,7 @@ public function testPrepareExportData($isArchiveSourceDirectory)
127
137
$ this ->filesystemMock
128
138
->expects ($ this ->once ())
129
139
->method ('getDirectoryWrite ' )
130
- ->with (DirectoryList::TMP )
140
+ ->with (DirectoryList::SYS_TMP )
131
141
->willReturn ($ this ->directoryMock );
132
142
$ this ->directoryMock
133
143
->expects ($ this ->exactly (4 ))
@@ -210,13 +220,13 @@ public static function prepareExportDataDataProvider()
210
220
public function testPrepareExportDataWithLocalizedException ()
211
221
{
212
222
$ this ->expectException ('Magento\Framework\Exception\LocalizedException ' );
213
- $ tmpFilesDirectoryPath = $ this ->subdirectoryPath . 'tmp/ ' ;
223
+ $ tmpFilesDirectoryPath = $ this ->subdirectoryPath . 'tmp/ ' . $ this -> getInstanceIdentifier () . ' / ' ;
214
224
$ archivePath = $ this ->subdirectoryPath . $ this ->archiveName ;
215
225
216
226
$ this ->filesystemMock
217
227
->expects ($ this ->once ())
218
228
->method ('getDirectoryWrite ' )
219
- ->with (DirectoryList::TMP )
229
+ ->with (DirectoryList::SYS_TMP )
220
230
->willReturn ($ this ->directoryMock );
221
231
$ this ->reportWriterMock
222
232
->expects ($ this ->once ())
0 commit comments