5
5
*/
6
6
namespace Magento \Config \Console \Command ;
7
7
8
- use Symfony \Component \Console \Tester \CommandTester ;
9
- use Magento \Store \Model \ScopeInterface as ModelScopeInterface ;
8
+ use Magento \Store \Model \ScopeInterface ;
10
9
use Magento \TestFramework \Helper \Bootstrap ;
11
- use Magento \Config \Model \Config \Structure \Data ;
12
- use Magento \Config \Model \Config \Structure ;
13
- use Magento \Config \Model \Config \Structure \Reader as StructureReader ;
14
10
use Magento \Framework \Console \Cli ;
15
11
use Magento \Framework \ObjectManagerInterface ;
12
+ use Symfony \Component \Console \Tester \CommandTester ;
16
13
use Magento \Framework \Filesystem ;
17
14
use Magento \Framework \App \Filesystem \DirectoryList ;
18
- use Magento \Framework \App \DeploymentConfig \Reader as DeploymentConfigReader ;
19
- use Magento \Framework \App \DeploymentConfig \Writer ;
20
- use Magento \Framework \App \Area ;
21
- use Magento \Framework \App \Config \FileResolver ;
22
15
use Magento \Framework \Config \File \ConfigFilePool ;
23
- use Magento \Framework \Config \ScopeInterface as ConfigScopeInterface ;
24
- use Magento \Framework \Config \FileIteratorFactory ;
25
- use \Magento \Framework \App \AreaList ;
26
- use \Magento \Backend \App \Area \FrontNameResolver ;
16
+ use Magento \Framework \App \DeploymentConfig \Reader ;
17
+ use Magento \Framework \App \DeploymentConfig \Writer ;
27
18
28
- /**
29
- * Test for ConfigShowCommand.
30
- *
31
- * @see ConfigShowCommand
32
- * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
33
- */
34
19
class ConfigShowCommandTest extends \PHPUnit_Framework_TestCase
35
20
{
36
21
/**
@@ -54,7 +39,7 @@ class ConfigShowCommandTest extends \PHPUnit_Framework_TestCase
54
39
private $ configFilePool ;
55
40
56
41
/**
57
- * @var DeploymentConfigReader
42
+ * @var Reader
58
43
*/
59
44
private $ reader ;
60
45
@@ -75,26 +60,10 @@ class ConfigShowCommandTest extends \PHPUnit_Framework_TestCase
75
60
76
61
public function setUp ()
77
62
{
78
- Bootstrap::getInstance ()->reinitialize ();
79
-
80
63
$ this ->objectManager = Bootstrap::getObjectManager ();
81
-
82
- $ this ->objectManager ->get (ConfigScopeInterface::class)->setCurrentScope (Area::AREA_ADMINHTML );
83
-
84
- $ this ->objectManager ->get (AreaList::class)->getArea (FrontNameResolver::AREA_CODE )->load (Area::PART_CONFIG );
85
-
86
- $ fileIteratorFactory = $ this ->objectManager ->get (FileIteratorFactory::class);
87
- $ fileIterator = $ fileIteratorFactory ->create ([__DIR__ . '/../../_files/system.xml ' ]);
88
-
89
- $ fileResolverMock = $ this ->getMockBuilder (FileResolver::class)->disableOriginalConstructor ()->getMock ();
90
- $ fileResolverMock ->expects ($ this ->any ())->method ('get ' )->will ($ this ->returnValue ($ fileIterator ));
91
- $ structureReader = $ this ->objectManager ->create (StructureReader::class, ['fileResolver ' => $ fileResolverMock ]);
92
- $ structureData = $ this ->objectManager ->create (Data::class, ['reader ' => $ structureReader ]);
93
- $ this ->objectManager ->create (Structure::class, ['structureData ' => $ structureData ]);
94
-
95
64
$ this ->configFilePool = $ this ->objectManager ->get (ConfigFilePool::class);
96
65
$ this ->filesystem = $ this ->objectManager ->get (Filesystem::class);
97
- $ this ->reader = $ this ->objectManager ->get (DeploymentConfigReader ::class);
66
+ $ this ->reader = $ this ->objectManager ->get (Reader ::class);
98
67
$ this ->writer = $ this ->objectManager ->get (Writer::class);
99
68
100
69
$ this ->config = $ this ->loadConfig ();
@@ -169,7 +138,7 @@ public function executeDataProvider()
169
138
'web/test/test_value_2 ' => ['value2.local_config.default.test ' ],
170
139
'web/test2/test_value_3 ' => ['value3.config.default.test ' ],
171
140
'web/test2/test_value_4 ' => ['value4.env.default.test ' ],
172
- 'web/test3/test_value_5 ' => ['****** ' ],
141
+ 'carriers/fedex/account ' => ['****** ' ],
173
142
'web/test ' => [
174
143
'web/test/test_value_1 - value1.db.default.test ' ,
175
144
'web/test/test_value_2 - value2.local_config.default.test ' ,
@@ -189,12 +158,12 @@ public function executeDataProvider()
189
158
'web/test/test_value_2 - value2.local_config.default.test ' ,
190
159
'web/test2/test_value_3 - value3.config.default.test ' ,
191
160
'web/test2/test_value_4 - value4.env.default.test ' ,
192
- 'web/test3/test_value_5 - ****** ' ,
161
+ 'carriers/fedex/account - ****** ' ,
193
162
],
194
163
]
195
164
],
196
165
[
197
- ModelScopeInterface ::SCOPE_WEBSITES ,
166
+ ScopeInterface ::SCOPE_WEBSITES ,
198
167
'base ' ,
199
168
Cli::RETURN_SUCCESS ,
200
169
[
@@ -225,7 +194,7 @@ public function executeDataProvider()
225
194
]
226
195
],
227
196
[
228
- ModelScopeInterface ::SCOPE_STORES ,
197
+ ScopeInterface ::SCOPE_STORES ,
229
198
'default ' ,
230
199
Cli::RETURN_SUCCESS ,
231
200
[
0 commit comments