Skip to content

Commit c6d1732

Browse files
committed
B2B-2015: [AWS S3] [Integration Tests]: Investigate Test Failures in Framework
1 parent 3fa6861 commit c6d1732

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

dev/tests/integration/testsuite/Magento/Framework/File/_files/framework_file_name.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,18 @@
1111

1212
/** @var $mediaDirectory \Magento\Framework\Filesystem\Directory\WriteInterface */
1313
$mediaDirectory = $objectManager->get(\Magento\Framework\Filesystem::class)->getDirectoryWrite(DirectoryList::MEDIA);
14+
/** @var $varDirectory \Magento\Framework\Filesystem\Directory\WriteInterface */
15+
$varDirectory = $objectManager->get(\Magento\Framework\Filesystem::class)->getDirectoryWrite(DirectoryList::VAR_DIR);
1416
$dir = 'image';
1517
$mediaDirectory->create($dir);
1618
$imageContent = file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'magento_small_image.jpg');
17-
$driver = $mediaDirectory->getDriver();
18-
$driver->filePutContents($mediaDirectory->getAbsolutePath($dir . '/image_one.jpg'), $imageContent);
19-
$driver->filePutContents($mediaDirectory->getAbsolutePath($dir . '/image_two.jpg'), $imageContent);
20-
$driver->filePutContents($mediaDirectory->getAbsolutePath($dir . '/image_two_1.jpg'), $imageContent);
19+
20+
$mediaDriver = $mediaDirectory->getDriver();
21+
$mediaDriver->filePutContents($mediaDirectory->getAbsolutePath($dir . '/image_one.jpg'), $imageContent);
22+
$mediaDriver->filePutContents($mediaDirectory->getAbsolutePath($dir . '/image_two.jpg'), $imageContent);
23+
$mediaDriver->filePutContents($mediaDirectory->getAbsolutePath($dir . '/image_two_1.jpg'), $imageContent);
24+
25+
$varDirectory->create($dir);
26+
$varDirectory->getDriver()->filePutContents($varDirectory->getAbsolutePath($dir . '/image_one.jpg'), $imageContent);
27+
2128
unset($imageContent);

dev/tests/integration/testsuite/Magento/Framework/File/_files/framework_file_name_rollback.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@
77

88
use Magento\Framework\App\Filesystem\DirectoryList;
99

10-
/** @var \Magento\Framework\Filesystem\Directory\WriteInterface $mediaDirectory */
11-
$mediaDirectory = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
10+
$fileSystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
1211
\Magento\Framework\Filesystem::class
13-
)->getDirectoryWrite(
14-
DirectoryList::MEDIA
1512
);
13+
/** @var \Magento\Framework\Filesystem\Directory\WriteInterface $mediaDirectory */
14+
$mediaDirectory = $fileSystem->getDirectoryWrite(DirectoryList::MEDIA);
15+
/** @var \Magento\Framework\Filesystem\Directory\WriteInterface $varDirectory */
16+
$varDirectory = $fileSystem->getDirectoryWrite(DirectoryList::VAR_DIR);
1617

1718
$mediaDirectory->delete('image');
19+
$varDirectory->delete('image');

0 commit comments

Comments
 (0)