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(
167167 public function __destruct ()
168168 {
169169 try {
170- foreach ($ this ->tmpFiles as $ tmpFile ) {
170+ foreach ($ this ->tmpFiles as $ key => $ tmpFile ) {
171171 $ this ->tmpDirectoryWrite ->delete ($ tmpFile );
172+ unset($ this ->tmpFiles [$ key ]);
172173 }
173174 } catch (\Exception $ e ) {
174175 $ this ->logger ->error ($ e ->getMessage ());
@@ -192,7 +193,7 @@ private function copyFileToTmp(string $filePath): string
192193 $ this ->tmpDirectoryWrite ->create ();
193194 $ tmpPath = $ this ->storeTmpName ($ filePath );
194195 $ content = $ this ->remoteDirectoryWrite ->getDriver ()->fileGetContents ($ filePath );
195- $ filePath = $ this ->tmpDirectoryWrite ->getDriver ()->filePutContents ($ tmpPath , $ content )
196+ $ filePath = $ this ->tmpDirectoryWrite ->getDriver ()->filePutContents ($ tmpPath , $ content ) >= 0
196197 ? $ tmpPath
197198 : $ filePath ;
198199 }
Original file line number Diff line number Diff line change 2121use Magento \ImportExport \Model \Import ;
2222use Magento \ImportExport \Model \Import \ErrorProcessing \ProcessingErrorAggregatorInterface ;
2323use Magento \ImportExport \Model \Import \Source \Csv ;
24+ use Magento \RemoteStorage \Plugin \Image ;
2425use Magento \Store \Model \Store ;
2526use Magento \Store \Model \StoreManagerInterface ;
2627use Magento \TestFramework \Indexer \TestCase ;
@@ -109,6 +110,9 @@ protected function tearDown(): void
109110 // nothing to delete
110111 }
111112 }
113+ // Removing cached images from previous tests in cases when Remote storage is configured
114+ $ image = $ this ->objectManager ->get (Image::class);
115+ $ image ->__destruct ();
112116 }
113117
114118
You can’t perform that action at this time.
0 commit comments