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
functional
tests
app
Magento
Config
Test
TestStep
SetupConfigurationStep.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Config\Test\TestStep
;
8
9
use
Magento\Config\Test\Fixture\ConfigData
;
10
use Magento\Mtf\Fixture\FixtureFactory;
11
use Magento\Mtf\TestStep\TestStepInterface;
12
use
Magento\Mtf\Util\Command\Cli\Cache
;
13
17
class
SetupConfigurationStep
implements
TestStepInterface
18
{
24
protected
$fixtureFactory
;
25
31
protected
$configData
;
32
38
protected
$rollback
;
39
45
protected
$flushCache
;
46
52
private
$cache;
53
63
public
function
__construct
(
64
FixtureFactory
$fixtureFactory
,
65
Cache
$cache,
66
$configData
=
null
,
67
$rollback
=
false
,
68
$flushCache
=
false
69
) {
70
$this->fixtureFactory =
$fixtureFactory
;
71
$this->configData =
$configData
;
72
$this->rollback =
$rollback
;
73
$this->flushCache =
$flushCache
;
74
$this->cache =
$cache
;
75
}
76
82
public
function
run()
83
{
84
if
($this->configData ===
null
) {
85
return
[];
86
}
87
$prefix
= ($this->rollback ==
false
) ?
''
:
'_rollback'
;
88
89
$configData
= array_map(
'trim'
, explode(
','
, $this->configData));
90
$result
= [];
91
92
foreach
(
$configData
as $configDataSet) {
94
$config
= $this->fixtureFactory->createByCode(
'configData'
, [
'dataset'
=> $configDataSet .
$prefix
]);
95
if
(
$config
->hasData(
'section'
)) {
96
$config
->persist();
97
$result
= array_merge(
$result
,
$config
->getSection());
98
}
99
if
($this->flushCache) {
100
$this->cache->flush();
101
}
102
}
103
$config
= $this->fixtureFactory->createByCode(
'configData'
, [
'data'
=>
$result
]);
104
105
return
[
'config'
=>
$config
];
106
}
107
113
public
function
cleanup
()
114
{
115
$this->rollback =
true
;
116
$this->run();
117
}
118
}
Magento\Config\Test\TestStep\SetupConfigurationStep\$rollback
$rollback
Definition:
SetupConfigurationStep.php:38
$result
$result
Definition:
product_configurable_not_available_rollback.php:26
Magento\Config\Test\TestStep\SetupConfigurationStep\__construct
__construct(FixtureFactory $fixtureFactory, Cache $cache, $configData=null, $rollback=false, $flushCache=false)
Definition:
SetupConfigurationStep.php:63
Magento\Mtf\Util\Command\Cli\Cache
Definition:
Cache.php:14
$config
$config
Definition:
fraud_order.php:17
Magento\Config\Test\TestStep\SetupConfigurationStep\cleanup
cleanup()
Definition:
SetupConfigurationStep.php:113
Magento\Config\Test\TestStep
Definition:
SetupConfigurationStep.php:7
Magento\Config\Test\Fixture\ConfigData
Definition:
Section.php:7
Magento\Config\Test\TestStep\SetupConfigurationStep
Definition:
SetupConfigurationStep.php:17
$prefix
$prefix
Definition:
name.phtml:25
Magento\Config\Test\TestStep\SetupConfigurationStep\$configData
$configData
Definition:
SetupConfigurationStep.php:31
$cache
$cache
Definition:
application_cache.php:8
Magento\Config\Test\TestStep\SetupConfigurationStep\$fixtureFactory
$fixtureFactory
Definition:
SetupConfigurationStep.php:24
Magento\Config\Test\TestStep\SetupConfigurationStep\$flushCache
$flushCache
Definition:
SetupConfigurationStep.php:45