@@ -102,7 +102,142 @@ public function testDefault(\CliTester $I, \Codeception\Example $data): void
102
102
*
103
103
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
104
104
*/
105
- abstract protected function defaultDataProvider (): array ;
105
+ protected function defaultDataProvider (): array
106
+ {
107
+ return [
108
+ 'default configuration ' => [
109
+ 'variables ' => [
110
+ 'MAGENTO_CLOUD_VARIABLES ' => [
111
+ 'ADMIN_EMAIL ' => 'admin@example.com ' ,
112
+ ],
113
+ ],
114
+ 'expectedConfig ' => [
115
+ 'cron_consumers_runner ' => [
116
+ 'cron_run ' => false ,
117
+ 'max_messages ' => 10000 ,
118
+ 'consumers ' => [],
119
+ ],
120
+ 'directories ' => [
121
+ 'document_root_is_pub ' => true ,
122
+ ],
123
+ 'lock ' => [
124
+ 'provider ' => 'db ' ,
125
+ ],
126
+ ],
127
+ ],
128
+ 'test cron_consumers_runner with array and there is MAGENTO_CLOUD_LOCKS_DIR ' => [
129
+ 'variables ' => [
130
+ 'MAGENTO_CLOUD_VARIABLES ' => [
131
+ 'ADMIN_EMAIL ' => 'admin@example.com ' ,
132
+ 'CRON_CONSUMERS_RUNNER ' => [
133
+ 'cron_run ' => true ,
134
+ 'max_messages ' => 5000 ,
135
+ 'consumers ' => ['test ' ],
136
+ ],
137
+ ],
138
+ 'MAGENTO_CLOUD_LOCKS_DIR ' => '/tmp/locks ' ,
139
+ ],
140
+ 'expectedConfig ' => [
141
+ 'cron_consumers_runner ' => [
142
+ 'cron_run ' => true ,
143
+ 'max_messages ' => 5000 ,
144
+ 'consumers ' => ['test ' ],
145
+ ],
146
+ 'directories ' => [
147
+ 'document_root_is_pub ' => true ,
148
+ ],
149
+ 'lock ' => [
150
+ 'provider ' => 'file ' ,
151
+ 'config ' => [
152
+ 'path ' => '/tmp/locks ' ,
153
+ ],
154
+ ],
155
+ ],
156
+ ],
157
+ 'test cron_consumers_runner with wrong array, there is MAGENTO_CLOUD_LOCKS_DIR, LOCK_PROVIDER is db ' => [
158
+ 'variables ' => [
159
+ 'MAGENTO_CLOUD_VARIABLES ' => [
160
+ 'ADMIN_EMAIL ' => 'admin@example.com ' ,
161
+ 'LOCK_PROVIDER ' => 'db ' ,
162
+ 'CRON_CONSUMERS_RUNNER ' => [
163
+ 'cron_run ' => 'true ' ,
164
+ 'max_messages ' => 5000 ,
165
+ 'consumers ' => ['test ' ],
166
+ ],
167
+ ],
168
+ 'MAGENTO_CLOUD_LOCKS_DIR ' => '/tmp/locks ' ,
169
+ ],
170
+ 'expectedConfig ' => [
171
+ 'cron_consumers_runner ' => [
172
+ 'cron_run ' => false ,
173
+ 'max_messages ' => 5000 ,
174
+ 'consumers ' => ['test ' ],
175
+ ],
176
+ 'directories ' => [
177
+ 'document_root_is_pub ' => true ,
178
+ ],
179
+ 'lock ' => [
180
+ 'provider ' => 'db ' ,
181
+ ],
182
+ ],
183
+ ],
184
+ 'test cron_consumers_runner with string ' => [
185
+ 'variables ' => [
186
+ 'MAGENTO_CLOUD_VARIABLES ' => [
187
+ 'ADMIN_EMAIL ' => 'admin@example.com ' ,
188
+ 'CRON_CONSUMERS_RUNNER ' => '{"cron_run":true, "max_messages":100, "consumers":["test2"]} ' ,
189
+ ],
190
+ ],
191
+ 'expectedConfig ' => [
192
+ 'cron_consumers_runner ' => [
193
+ 'cron_run ' => true ,
194
+ 'max_messages ' => 100 ,
195
+ 'consumers ' => ['test2 ' ],
196
+ ],
197
+ 'directories ' => [
198
+ 'document_root_is_pub ' => true ,
199
+ ],
200
+ ],
201
+ ],
202
+ 'test cron_consumers_runner with wrong string ' => [
203
+ 'variables ' => [
204
+ 'MAGENTO_CLOUD_VARIABLES ' => [
205
+ 'ADMIN_EMAIL ' => 'admin@example.com ' ,
206
+ 'CRON_CONSUMERS_RUNNER ' => '{"cron_run":"true", "max_messages":100, "consumers":["test2"]} ' ,
207
+ ],
208
+ ],
209
+ 'expectedConfig ' => [
210
+ 'cron_consumers_runner ' => [
211
+ 'cron_run ' => false ,
212
+ 'max_messages ' => 100 ,
213
+ 'consumers ' => ['test2 ' ],
214
+ ],
215
+ 'directories ' => [
216
+ 'document_root_is_pub ' => true ,
217
+ ],
218
+ ],
219
+ ],
220
+ 'disabled static content symlinks 3 jobs ' => [
221
+ 'variables ' => [
222
+ 'MAGENTO_CLOUD_VARIABLES ' => [
223
+ 'ADMIN_EMAIL ' => 'admin@example.com ' ,
224
+ 'STATIC_CONTENT_SYMLINK ' => 'disabled ' ,
225
+ 'STATIC_CONTENT_THREADS ' => 3 ,
226
+ ],
227
+ ],
228
+ 'expectedConfig ' => [
229
+ 'cron_consumers_runner ' => [
230
+ 'cron_run ' => false ,
231
+ 'max_messages ' => 10000 ,
232
+ 'consumers ' => [],
233
+ ],
234
+ 'directories ' => [
235
+ 'document_root_is_pub ' => true ,
236
+ ],
237
+ ],
238
+ ],
239
+ ];
240
+ }
106
241
107
242
/**
108
243
* @param CliTester $I
0 commit comments