File tree Expand file tree Collapse file tree 3 files changed +24
-16
lines changed
Step/Deploy/PreDeploy/ConfigUpdate Expand file tree Collapse file tree 3 files changed +24
-16
lines changed Original file line number Diff line number Diff line change @@ -81,22 +81,20 @@ public function validate(): Validator\ResultInterface
81
81
);
82
82
}
83
83
84
- if (!$ this ->magentoVersion ->satisfies ('>= 2.4.7 ' )
85
- && $ this ->configurationChecker ->isConfigured (DeployInterface::VAR_USE_LUA , true )
86
- ) {
87
- $ errors [] = sprintf (
88
- '%s is available for Magento 2.4.7 and above ' ,
89
- DeployInterface::VAR_USE_LUA
90
- );
91
- }
84
+ if (!$ this ->magentoVersion ->satisfies ('>= 2.4.7 ' )) {
85
+ $ variables = [
86
+ DeployInterface::VAR_USE_LUA ,
87
+ DeployInterface::VAR_LUA_KEY ,
88
+ ];
92
89
93
- if (!$ this ->magentoVersion ->satisfies ('>= 2.4.7 ' )
94
- && $ this ->configurationChecker ->isConfigured (DeployInterface::VAR_LUA_KEY , true )
95
- ) {
96
- $ errors [] = sprintf (
97
- '%s is available for Magento 2.4.7 and above ' ,
98
- DeployInterface::VAR_LUA_KEY
99
- );
90
+ foreach ($ variables as $ variableName ) {
91
+ if ($ this ->configurationChecker ->isConfigured ($ variableName , true )) {
92
+ $ errors [] = sprintf (
93
+ '%s is available for Magento 2.4.7 and later. ' ,
94
+ $ variableName
95
+ );
96
+ }
97
+ }
100
98
}
101
99
102
100
if ($ errors ) {
Original file line number Diff line number Diff line change @@ -118,6 +118,8 @@ public function testGetDefaultsForDeploy(): void
118
118
DeployInterface::VAR_CACHE_REDIS_BACKEND => 'Cm_Cache_Backend_Redis ' ,
119
119
DeployInterface::VAR_REMOTE_STORAGE => [],
120
120
DeployInterface::VAR_SCD_NO_PARENT => false ,
121
+ DeployInterface::VAR_USE_LUA => false ,
122
+ DeployInterface::VAR_LUA_KEY => true ,
121
123
],
122
124
$ this ->schema ->getDefaults (StageConfigInterface::STAGE_DEPLOY )
123
125
);
Original file line number Diff line number Diff line change 19
19
use PHPUnit \Framework \TestCase ;
20
20
use Psr \Log \LoggerInterface ;
21
21
use Magento \MagentoCloud \Package \MagentoVersion ;
22
+ use Magento \MagentoCloud \Config \Stage \DeployInterface ;
22
23
23
24
/**
24
25
* @inheritdoc
@@ -72,6 +73,11 @@ class CacheTest extends TestCase
72
73
*/
73
74
private $ magentoVersion ;
74
75
76
+ /**
77
+ * @var DeployInterface
78
+ */
79
+ private $ stageConfig ;
80
+
75
81
/**
76
82
* @inheritdoc
77
83
*/
@@ -82,13 +88,15 @@ protected function setUp(): void
82
88
$ this ->configReaderMock = $ this ->createMock (ConfigReader::class);
83
89
$ this ->cacheConfigMock = $ this ->createMock (CacheFactory::class);
84
90
$ this ->magentoVersion = $ this ->createMock (MagentoVersion::class);
91
+ $ this ->stageConfig = $ this ->createMock (DeployInterface::class);
85
92
86
93
$ this ->step = new Cache (
87
94
$ this ->configReaderMock ,
88
95
$ this ->configWriterMock ,
89
96
$ this ->loggerMock ,
90
97
$ this ->cacheConfigMock ,
91
- $ this ->magentoVersion
98
+ $ this ->magentoVersion ,
99
+ $ this ->stageConfig
92
100
);
93
101
94
102
$ this ->socketCreateMock = $ this ->getFunctionMock (
You can’t perform that action at this time.
0 commit comments