File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
app/code/Magento/RemoteStorage/Plugin
dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -167,8 +167,9 @@ public function aroundSave(
167
167
public function __destruct ()
168
168
{
169
169
try {
170
- foreach ($ this ->tmpFiles as $ tmpFile ) {
170
+ foreach ($ this ->tmpFiles as $ key => $ tmpFile ) {
171
171
$ this ->tmpDirectoryWrite ->delete ($ tmpFile );
172
+ unset($ this ->tmpFiles [$ key ]);
172
173
}
173
174
} catch (\Exception $ e ) {
174
175
$ this ->logger ->error ($ e ->getMessage ());
@@ -192,7 +193,7 @@ private function copyFileToTmp(string $filePath): string
192
193
$ this ->tmpDirectoryWrite ->create ();
193
194
$ tmpPath = $ this ->storeTmpName ($ filePath );
194
195
$ content = $ this ->remoteDirectoryWrite ->getDriver ()->fileGetContents ($ filePath );
195
- $ filePath = $ this ->tmpDirectoryWrite ->getDriver ()->filePutContents ($ tmpPath , $ content )
196
+ $ filePath = $ this ->tmpDirectoryWrite ->getDriver ()->filePutContents ($ tmpPath , $ content ) >= 0
196
197
? $ tmpPath
197
198
: $ filePath ;
198
199
}
Original file line number Diff line number Diff line change 21
21
use Magento \ImportExport \Model \Import ;
22
22
use Magento \ImportExport \Model \Import \ErrorProcessing \ProcessingErrorAggregatorInterface ;
23
23
use Magento \ImportExport \Model \Import \Source \Csv ;
24
+ use Magento \RemoteStorage \Plugin \Image ;
24
25
use Magento \Store \Model \Store ;
25
26
use Magento \Store \Model \StoreManagerInterface ;
26
27
use Magento \TestFramework \Indexer \TestCase ;
@@ -109,6 +110,9 @@ protected function tearDown(): void
109
110
// nothing to delete
110
111
}
111
112
}
113
+ // Removing cached images from previous tests in cases when Remote storage is configured
114
+ $ image = $ this ->objectManager ->get (Image::class);
115
+ $ image ->__destruct ();
112
116
}
113
117
114
118
You can’t perform that action at this time.
0 commit comments