File tree Expand file tree Collapse file tree 2 files changed +17
-8
lines changed
dev/tests/integration/testsuite/Magento/Framework/File/_files Expand file tree Collapse file tree 2 files changed +17
-8
lines changed Original file line number Diff line number Diff line change 11
11
12
12
/** @var $mediaDirectory \Magento\Framework\Filesystem\Directory\WriteInterface */
13
13
$ 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 );
14
16
$ dir = 'image ' ;
15
17
$ mediaDirectory ->create ($ dir );
16
18
$ 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
+
21
28
unset($ imageContent );
Original file line number Diff line number Diff line change 7
7
8
8
use Magento \Framework \App \Filesystem \DirectoryList ;
9
9
10
- /** @var \Magento\Framework\Filesystem\Directory\WriteInterface $mediaDirectory */
11
- $ mediaDirectory = \Magento \TestFramework \Helper \Bootstrap::getObjectManager ()->get (
10
+ $ fileSystem = \Magento \TestFramework \Helper \Bootstrap::getObjectManager ()->get (
12
11
\Magento \Framework \Filesystem::class
13
- )->getDirectoryWrite (
14
- DirectoryList::MEDIA
15
12
);
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 );
16
17
17
18
$ mediaDirectory ->delete ('image ' );
19
+ $ varDirectory ->delete ('image ' );
You can’t perform that action at this time.
0 commit comments