Skip to content

Commit 06aa753

Browse files
committed
B2B-2022:[AWS S3] [Integration Tests]: Investigate Test Failures in Catalog module
- Added more review fixes
1 parent 535add7 commit 06aa753

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +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->mediaDirectory->isExist(
90+
$this->assertTrue($this->mediaDirectory->isExist(
9191
$this->getFileAbsolutePath($expectation['tmp_media_path'])
92-
);
92+
));
9393
}
9494

9595
/**
@@ -286,6 +286,6 @@ private function createFileInSysTmpDir(string $name): void
286286
*/
287287
private function getFileAbsolutePath(string $tmpPath): string
288288
{
289-
return $this->mediaDirectory->getAbsolutePath($this->config->getBaseTmpMediaPath(). $tmpPath);
289+
return $this->mediaDirectory->getAbsolutePath($this->config->getBaseTmpMediaPath() . $tmpPath);
290290
}
291291
}

dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Save/ImagesTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ private function assertSuccessfulImageSave(array $expectation): void
138138
$this->assertEquals($expectation['small_image'], $product->getData('small_image'));
139139
$this->assertEquals($expectation['thumbnail'], $product->getData('thumbnail'));
140140
$this->assertEquals($expectation['swatch_image'], $product->getData('swatch_image'));
141-
$pathExpected = $this->mediaDirectory->getAbsolutePath() . $expectation['image'];
142-
$this->mediaDirectory->isExist($pathExpected);
141+
$this->assertFileExists(
142+
$this->mediaDirectory->getAbsolutePath($this->config->getBaseMediaPath() . $expectation['image'])
143+
);
143144
}
144145
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public function renameFile($path, $newPath, WriteInterface $targetDirectory = nu
113113
{
114114
$this->validatePath($path);
115115
$this->validatePath($newPath);
116-
$this->isFile($path);
116+
$this->assertIsFile($path);
117117
$targetDirectory = $targetDirectory ?: $this;
118118
if (!$targetDirectory->isExist($this->driver->getParentDirectory($newPath))) {
119119
$targetDirectory->create($this->driver->getParentDirectory($newPath));

0 commit comments

Comments
 (0)