Skip to content

Commit ee6eff9

Browse files
committed
B2B-2022:[AWS S3] [Integration Tests]: Investigate Test Failures in Catalog module
- Added more fix for ImagesTest and Upload test
1 parent 82ada4f commit ee6eff9

File tree

2 files changed

+5
-4
lines changed
  • dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Gallery
  • lib/internal/Magento/Framework/Filesystem/Directory

2 files changed

+5
-4
lines changed

dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Gallery/UploadTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ public function testUploadAction(array $file, array $expectation): void
8787
$this->assertEquals($jsonBody['url'], $expectation['url']);
8888
$this->assertArrayNotHasKey('error', $jsonBody);
8989
$this->assertArrayNotHasKey('errorcode', $jsonBody);
90-
$this->assertTrue($this->mediaDirectory->isExist($this->mediaDirectory->getAbsolutePath()));
90+
$this->mediaDirectory->isExist(
91+
$this->getFileAbsolutePath($expectation['tmp_media_path'])
92+
);
9193
}
9294

9395
/**
@@ -284,6 +286,6 @@ private function createFileInSysTmpDir(string $name): void
284286
*/
285287
private function getFileAbsolutePath(string $tmpPath): string
286288
{
287-
return $this->mediaDirectory->getAbsolutePath($this->config->getBaseMediaPath() . $tmpPath);
289+
return $this->mediaDirectory->getAbsolutePath($this->config->getBaseTmpMediaPath(). $tmpPath);
288290
}
289291
}

lib/internal/Magento/Framework/Filesystem/Directory/Write.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ public function renameFile($path, $newPath, WriteInterface $targetDirectory = nu
113113
{
114114
$this->validatePath($path);
115115
$this->validatePath($newPath);
116-
$this->getRelativePath();
117-
$this->getDriver()->isFile($path);
116+
$this->isFile($path);
118117
$targetDirectory = $targetDirectory ?: $this;
119118
if (!$targetDirectory->isExist($this->driver->getParentDirectory($newPath))) {
120119
$targetDirectory->create($this->driver->getParentDirectory($newPath));

0 commit comments

Comments
 (0)