Skip to content

Commit 7760766

Browse files
committed
B2B:2037:[AWS S3] [Integration Tests]: Investigate Test Failures in MediaGallerySynchronization & MediaGallerySynchronizationMetadata modules
- Added review fixes
1 parent c31974b commit 7760766

File tree

4 files changed

+18
-12
lines changed

4 files changed

+18
-12
lines changed

app/code/Magento/MediaGalleryMetadata/Model/Gif/ReadFile.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
use Magento\Framework\Exception\LocalizedException;
1212
use Magento\Framework\App\Filesystem\DirectoryList;
1313
use Magento\Framework\Filesystem\DriverInterface;
14-
use Magento\MediaGalleryMetadata\Model\SegmentNames;
1514
use Magento\MediaGalleryMetadataApi\Model\FileInterface;
1615
use Magento\MediaGalleryMetadataApi\Model\FileInterfaceFactory;
1716
use Magento\MediaGalleryMetadataApi\Model\ReadFileInterface;
@@ -45,26 +44,19 @@ class ReadFile implements ReadFileInterface
4544
*/
4645
private $fileFactory;
4746

48-
/**
49-
* @var SegmentNames
50-
*/
51-
private $segmentNames;
52-
5347
/**
5448
* @param FileInterfaceFactory $fileFactory
5549
* @param SegmentInterfaceFactory $segmentFactory
56-
* @param SegmentNames $segmentNames
5750
* @param Filesystem $filesystem
51+
* @throws FileSystemException
5852
*/
5953
public function __construct(
6054
FileInterfaceFactory $fileFactory,
6155
SegmentInterfaceFactory $segmentFactory,
62-
SegmentNames $segmentNames,
6356
Filesystem $filesystem
6457
) {
6558
$this->fileFactory = $fileFactory;
6659
$this->segmentFactory = $segmentFactory;
67-
$this->segmentNames = $segmentNames;
6860
$this->filesystem = $filesystem;
6961
$this->driver = $this->filesystem->getDirectoryWrite(DirectoryList::MEDIA)->getDriver();
7062
}

app/code/Magento/MediaGalleryMetadata/Model/Png/ReadFile.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ class ReadFile implements ReadFileInterface
5050
* @param FileInterfaceFactory $fileFactory
5151
* @param SegmentInterfaceFactory $segmentFactory
5252
* @param Filesystem $filesystem
53+
* @throws FileSystemException
5354
*/
5455
public function __construct(
5556
FileInterfaceFactory $fileFactory,

app/code/Magento/MediaGallerySynchronization/Test/Integration/Model/SynchronizeFilesTest.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ public function testExecute(
8383

8484
$this->assertEquals($title, pathinfo($loadedAsset->getTitle(), PATHINFO_FILENAME));
8585
$this->assertEquals($source, $loadedAsset->getSource());
86-
$this->driver->deleteFile($modifiableFilePath);
8786
}
8887

8988
/**
@@ -101,4 +100,12 @@ public function filesProvider(): array
101100
]
102101
];
103102
}
103+
104+
/**
105+
* @inheritdoc
106+
*/
107+
public function tearDown(): void
108+
{
109+
$this->mediaDirectory->getDriver()->deleteFile($this->mediaDirectory->getAbsolutePath());
110+
}
104111
}

dev/tests/integration/testsuite/Magento/MediaGallerySynchronizationMetadata/Model/SynchronizeFilesTest.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,6 @@ public function testExecute(
9595
$this->assertEquals($title, pathinfo($loadedAssets->getTitle(), PATHINFO_FILENAME));
9696
$this->assertEquals($description, $loadedAssets->getDescription());
9797
$this->assertEquals($keywords, $loadedKeywords);
98-
99-
$this->driver->deleteFile($modifiableFilePath);
10098
}
10199

102100
/**
@@ -148,4 +146,12 @@ function (KeywordInterface $keyword) {
148146
$keywords
149147
);
150148
}
149+
150+
/**
151+
* @inheritdoc
152+
*/
153+
public function tearDown(): void
154+
{
155+
$this->mediaDirectory->getDriver()->deleteFile($this->mediaDirectory->getAbsolutePath());
156+
}
151157
}

0 commit comments

Comments
 (0)