Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
magento2-base
dev
tests
integration
testsuite
Magento
CatalogImportExport
Model
Import
_files
import_with_filesystem_images.php
Go to the documentation of this file.
1
<?php
8
$mediaDirectory
=
\Magento\TestFramework\Helper\Bootstrap::getObjectManager
()->get(
9
\
Magento
\Framework\Filesystem::class
10
)->getDirectoryWrite(
11
\
Magento
\Framework\
App
\Filesystem\DirectoryList::MEDIA
12
);
13
14
$path
=
'catalog'
. DIRECTORY_SEPARATOR .
'product'
;
15
// Is required for using importDataForMediaTest method.
16
$mediaDirectory
->create(
'import'
);
17
$mediaDirectory
->create(
$path
);
18
$dirPath
=
$mediaDirectory
->getAbsolutePath(
$path
);
19
20
$items
= [
21
[
22
'source'
=>
__DIR__
.
'/../../../../../Magento/Catalog/_files/magento_image.jpg'
,
23
'dest'
=>
$dirPath
.
'/magento_image.jpg'
,
24
],
25
[
26
'source'
=>
__DIR__
.
'/../../../../../Magento/Catalog/_files/magento_small_image.jpg'
,
27
'dest'
=>
$dirPath
.
'/magento_small_image.jpg'
,
28
],
29
[
30
'source'
=>
__DIR__
.
'/../../../../../Magento/Catalog/_files/magento_thumbnail.jpg'
,
31
'dest'
=>
$dirPath
.
'/magento_thumbnail.jpg'
,
32
],
33
[
34
'source'
=>
__DIR__
.
'/magento_additional_image_one.jpg'
,
35
'dest'
=>
$dirPath
.
'/magento_additional_image_one.jpg'
,
36
],
37
[
38
'source'
=>
__DIR__
.
'/magento_additional_image_two.jpg'
,
39
'dest'
=>
$dirPath
.
'/magento_additional_image_two.jpg'
,
40
],
41
];
42
43
foreach
(
$items
as
$item
) {
44
copy(
$item
[
'source'
],
$item
[
'dest'
]);
45
}
Magento\Framework\App
__DIR__
defined('TESTS_BP')||define('TESTS_BP' __DIR__
Definition:
_bootstrap.php:60
$item
$item
Definition:
partial_invoice.php:27
$dirPath
$dirPath
Definition:
import_with_filesystem_images.php:18
Magento
$mediaDirectory
$mediaDirectory
Definition:
import_with_filesystem_images.php:8
$items
$items
Definition:
import_with_filesystem_images.php:20
$path
$path
Definition:
import_with_filesystem_images.php:14
Magento\TestFramework\Helper\Bootstrap\getObjectManager
static getObjectManager()
Definition:
Bootstrap.php:125