5
5
*/
6
6
namespace Magento \Config \Console \Command ;
7
7
8
+ use Magento \Config \Console \Command \ConfigShow \ConfigSourceAggregated ;
9
+ use Magento \Framework \App \Config \ScopePathResolver ;
8
10
use Magento \Store \Model \ScopeInterface ;
9
11
use Magento \TestFramework \Helper \Bootstrap ;
10
12
use Magento \Framework \App \Config \ScopeConfigInterface ;
@@ -20,19 +22,25 @@ class ConfigShowCommandTest extends \PHPUnit_Framework_TestCase
20
22
private $ objectManager ;
21
23
22
24
/**
23
- * @var ScopeConfigInterface
25
+ * @var ConfigSourceAggregated
24
26
*/
25
- private $ appConfig ;
27
+ private $ config ;
26
28
27
29
/**
28
30
* @var CommandTester
29
31
*/
30
32
private $ commandTester ;
31
33
34
+ /**
35
+ * @var ScopePathResolver
36
+ */
37
+ private $ pathResolver ;
38
+
32
39
public function setUp ()
33
40
{
34
41
$ this ->objectManager = Bootstrap::getObjectManager ();
35
- $ this ->appConfig = $ this ->objectManager ->get (ScopeConfigInterface::class);
42
+ $ this ->config = $ this ->objectManager ->get (ConfigSourceAggregated::class);
43
+ $ this ->pathResolver = $ this ->objectManager ->get (ScopePathResolver::class);
36
44
37
45
$ command = $ this ->objectManager ->create (ConfigShowCommand::class);
38
46
$ this ->commandTester = new CommandTester ($ command );
@@ -48,9 +56,9 @@ public function setUp()
48
56
*/
49
57
public function testExecute ($ scope , $ scopeCode , array $ configs )
50
58
{
51
- foreach ($ configs as $ configPath => $ configValue ) {
59
+ foreach ($ configs as $ inputPath => $ configValue ) {
52
60
$ arguments = [
53
- ConfigShowCommand::INPUT_ARGUMENT_PATH => $ configPath
61
+ ConfigShowCommand::INPUT_ARGUMENT_PATH => $ inputPath
54
62
];
55
63
56
64
if ($ scope !== null ) {
@@ -62,7 +70,8 @@ public function testExecute($scope, $scopeCode, array $configs)
62
70
63
71
$ this ->commandTester ->execute ($ arguments );
64
72
65
- $ appConfigValue = $ this ->appConfig ->getValue ($ configPath , $ scope , $ scopeCode );
73
+ $ configPath = $ this ->pathResolver ->resolve ($ inputPath , $ scope , $ scopeCode );
74
+ $ appConfigValue = $ this ->config ->get ($ configPath );
66
75
$ this ->assertEquals (
67
76
Cli::RETURN_SUCCESS ,
68
77
$ this ->commandTester ->getStatusCode ()
0 commit comments