Skip to content

Commit

Permalink
Merge pull request #7119 from magento-arcticfoxes/B2B-1861
Browse files Browse the repository at this point in the history
B2B-1861: [Test] s3 - Refactor WebAPI tests to add support for Remote Storage
  • Loading branch information
joanhe authored Oct 13, 2021
2 parents 9ff22de + b635d26 commit 9c8d636
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,9 @@ protected function verifyImageAttribute($customAttributeArray, $expectedFileName
$this->assertStringContainsString($expectedFileName, $customAttribute[AttributeValue::VALUE]);
$mediaDirectory = $this->fileSystem->getDirectoryWrite(DirectoryList::MEDIA);
$customerMediaPath = $mediaDirectory->getAbsolutePath(CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER);
$imageAttributeFound = file_exists($customerMediaPath . $customAttribute[AttributeValue::VALUE]);
$imageAttributeFound = $mediaDirectory->getDriver()->isExists(
$customerMediaPath . $customAttribute[AttributeValue::VALUE]
);
$this->assertTrue($imageAttributeFound, 'Expected file was not created');
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@

/** @var WriteInterface $mediaDirectory */
$mediaDirectory = $filesystem->getDirectoryWrite(DirectoryList::MEDIA);
$mediaPath = $mediaDirectory->getAbsolutePath();
$baseTmpMediaPath = $config->getBaseTmpMediaPath();
$mediaDirectory->create($baseTmpMediaPath);

Expand All @@ -65,9 +64,10 @@
$associatedProductIds = [];
$firstAttributeValues = [];
$secondAttributeValues = [];

$testImagePath = __DIR__ . '/magento_image.jpg';
$mediaImage = $mediaPath . '/' . $baseTmpMediaPath . '/magento_image.jpg';
copy($testImagePath, $mediaImage);
$mediaImage = $mediaDirectory->getAbsolutePath($baseTmpMediaPath . DIRECTORY_SEPARATOR . 'magento_image.jpg');
$result = $mediaDirectory->getDriver()->filePutContents($mediaImage, file_get_contents($testImagePath));

array_shift($firstAttributeOptions);
array_shift($secondAttributeOptions);
Expand Down

0 comments on commit 9c8d636

Please sign in to comment.