Skip to content

Commit 9c8d636

Browse files
authored
Merge pull request #7119 from magento-arcticfoxes/B2B-1861
B2B-1861: [Test] s3 - Refactor WebAPI tests to add support for Remote Storage
2 parents 9ff22de + b635d26 commit 9c8d636

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

dev/tests/api-functional/testsuite/Magento/Customer/Api/AccountManagementCustomAttributesTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,9 @@ protected function verifyImageAttribute($customAttributeArray, $expectedFileName
186186
$this->assertStringContainsString($expectedFileName, $customAttribute[AttributeValue::VALUE]);
187187
$mediaDirectory = $this->fileSystem->getDirectoryWrite(DirectoryList::MEDIA);
188188
$customerMediaPath = $mediaDirectory->getAbsolutePath(CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER);
189-
$imageAttributeFound = file_exists($customerMediaPath . $customAttribute[AttributeValue::VALUE]);
189+
$imageAttributeFound = $mediaDirectory->getDriver()->isExists(
190+
$customerMediaPath . $customAttribute[AttributeValue::VALUE]
191+
);
190192
$this->assertTrue($imageAttributeFound, 'Expected file was not created');
191193
}
192194
}

dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/configurable_products_with_two_attributes_combination.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151

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

@@ -65,9 +64,10 @@
6564
$associatedProductIds = [];
6665
$firstAttributeValues = [];
6766
$secondAttributeValues = [];
67+
6868
$testImagePath = __DIR__ . '/magento_image.jpg';
69-
$mediaImage = $mediaPath . '/' . $baseTmpMediaPath . '/magento_image.jpg';
70-
copy($testImagePath, $mediaImage);
69+
$mediaImage = $mediaDirectory->getAbsolutePath($baseTmpMediaPath . DIRECTORY_SEPARATOR . 'magento_image.jpg');
70+
$result = $mediaDirectory->getDriver()->filePutContents($mediaImage, file_get_contents($testImagePath));
7171

7272
array_shift($firstAttributeOptions);
7373
array_shift($secondAttributeOptions);

0 commit comments

Comments
 (0)