File tree Expand file tree Collapse file tree 3 files changed +11
-12
lines changed
lib/internal/Magento/Framework Expand file tree Collapse file tree 3 files changed +11
-12
lines changed Original file line number Diff line number Diff line change 6
6
7
7
namespace Magento \Framework \App ;
8
8
9
+ use Magento \Framework \Config \ConfigOptionsListConstants ;
10
+
9
11
/**
10
12
* Application deployment configuration
11
13
*/
@@ -39,13 +41,6 @@ class DeploymentConfig
39
41
*/
40
42
private $ overrideData ;
41
43
42
- /**
43
- * Availability of deployment config file
44
- *
45
- * @var bool
46
- */
47
- private $ isAvailable ;
48
-
49
44
/**
50
45
* Constructor
51
46
*
@@ -85,7 +80,7 @@ public function isAvailable()
85
80
{
86
81
$ this ->data = null ;
87
82
$ this ->load ();
88
- return $ this ->isAvailable ;
83
+ return isset ( $ this ->flatData [ConfigOptionsListConstants:: CONFIG_PATH_INSTALL_DATE ]) ;
89
84
}
90
85
91
86
/**
@@ -128,7 +123,6 @@ private function load()
128
123
{
129
124
if (null === $ this ->data ) {
130
125
$ this ->data = $ this ->reader ->load ();
131
- $ this ->isAvailable = !empty ($ this ->data );
132
126
if ($ this ->overrideData ) {
133
127
$ this ->data = array_replace ($ this ->data , $ this ->overrideData );
134
128
}
Original file line number Diff line number Diff line change 7
7
namespace Magento \Framework \App \Test \Unit ;
8
8
9
9
use \Magento \Framework \App \DeploymentConfig ;
10
+ use \Magento \Framework \Config \ConfigOptionsListConstants ;
10
11
11
12
class DeploymentConfigTest extends \PHPUnit_Framework_TestCase
12
13
{
@@ -88,7 +89,9 @@ public function testGetters()
88
89
89
90
public function testIsAvailable ()
90
91
{
91
- $ this ->reader ->expects ($ this ->once ())->method ('load ' )->willReturn (['a ' => 1 ]);
92
+ $ this ->reader ->expects ($ this ->once ())->method ('load ' )->willReturn ([
93
+ ConfigOptionsListConstants::CONFIG_PATH_INSTALL_DATE => 1
94
+ ]);
92
95
$ object = new DeploymentConfig ($ this ->reader );
93
96
$ this ->assertTrue ($ object ->isAvailable ());
94
97
}
@@ -103,7 +106,9 @@ public function testNotAvailable()
103
106
public function testNotAvailableThenAvailable ()
104
107
{
105
108
$ this ->reader ->expects ($ this ->at (0 ))->method ('load ' )->willReturn ([]);
106
- $ this ->reader ->expects ($ this ->at (1 ))->method ('load ' )->willReturn (['a ' => 1 ]);
109
+ $ this ->reader ->expects ($ this ->at (1 ))->method ('load ' )->willReturn ([
110
+ ConfigOptionsListConstants::CONFIG_PATH_INSTALL_DATE => 1
111
+ ]);
107
112
$ object = new DeploymentConfig ($ this ->reader );
108
113
$ this ->assertFalse ($ object ->isAvailable ());
109
114
$ this ->assertTrue ($ object ->isAvailable ());
Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ public function isModuleInfoAvailable()
139
139
*/
140
140
private function loadConfigData ()
141
141
{
142
- if (null === $ this ->configData && ( $ this ->config ->isAvailable () )) {
142
+ if (null === $ this ->configData && null !== $ this ->config ->get (ConfigOptionsListConstants:: KEY_MODULES )) {
143
143
$ this ->configData = $ this ->config ->get (ConfigOptionsListConstants::KEY_MODULES );
144
144
}
145
145
}
You can’t perform that action at this time.
0 commit comments