Skip to content

Commit 975bd5b

Browse files
committed
B2B-2036: [AWS S3] [Integration Tests]: Investigate Test Failures in MediaGalleryRenditions module
1 parent 3253db0 commit 975bd5b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

app/code/Magento/MediaGalleryRenditions/Test/Integration/Model/GenerateRenditionsTest.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public static function tearDownAfterClass(): void
114114
public function testExecute(string $path, string $renditionPath): void
115115
{
116116
$this->copyImage($path);
117-
$this->generateRenditions->execute([self::TEST_DIR . $path]);
117+
$this->generateRenditions->execute([self::TEST_DIR . DIRECTORY_SEPARATOR . $path]);
118118
list($imageWidth, $imageHeight) = getimagesizefromstring($this->mediaDirectory->readFile($renditionPath));
119119
$this->assertTrue($this->mediaDirectory->isExist($renditionPath));
120120
$this->assertLessThanOrEqual(
@@ -130,13 +130,15 @@ public function testExecute(string $path, string $renditionPath): void
130130
}
131131

132132
/**
133-
* @param array $paths
133+
* Copies file from the integration test directory to the media directory
134+
*
135+
* @param string $path
134136
* @throws FileSystemException
135137
*/
136138
private function copyImage(string $path): void
137139
{
138140
$imagePath = realpath(__DIR__ . '/../../_files/' . $path);
139-
$modifiableFilePath = $this->mediaDirectory->getAbsolutePath(self::TEST_DIR . $path);
141+
$modifiableFilePath = $this->mediaDirectory->getAbsolutePath(self::TEST_DIR . DIRECTORY_SEPARATOR . $path);
140142
$this->driver->filePutContents(
141143
$modifiableFilePath,
142144
file_get_contents($imagePath)
@@ -150,11 +152,11 @@ public function renditionsImageProvider(): array
150152
{
151153
return [
152154
'rendition_image_not_generated' => [
153-
'paths' => '/magento_medium_image.jpg',
155+
'path' => 'magento_medium_image.jpg',
154156
'renditionPath' => ".renditions/" . self::TEST_DIR . "/magento_medium_image.jpg"
155157
],
156158
'rendition_image_generated' => [
157-
'paths' => '/magento_large_image.jpg',
159+
'path' => 'magento_large_image.jpg',
158160
'renditionPath' => ".renditions/" . self::TEST_DIR . "/magento_large_image.jpg"
159161
]
160162
];

0 commit comments

Comments
 (0)