@@ -146,3 +146,252 @@ Feature: Scaffold the test suite for an existing package
146
146
Warning: File already exists
147
147
"""
148
148
And the return code should be 0
149
+
150
+ Scenario : Scaffolds .travis.yml configuration file with travis[-<tag>[-append]].yml append/override files.
151
+ Given a community-command/travis-cache-append.yml file:
152
+ """
153
+ - $HOME/my-append-cache
154
+ """
155
+ And a community-command/travis-env-append.yml file:
156
+ """
157
+ - MY_APPEND_ENV="my-append-env"
158
+ """
159
+ And a community-command/travis-matrix-append.yml file:
160
+ """
161
+ - php: 99.97
162
+ env: WP_VERSION=9997.9997
163
+ """
164
+ And a community-command/travis-before_install-append.yml file:
165
+ """
166
+ - bash bin/my-append-before_install.sh
167
+ - php -m
168
+ """
169
+ And a community-command/travis-install-append.yml file:
170
+ """
171
+ - bash bin/my-append-install.sh
172
+ """
173
+ And a community-command/travis-before_script-append.yml file:
174
+ """
175
+ - bash bin/my-append-before_script.sh
176
+ """
177
+ And a community-command/travis-script-append.yml file:
178
+ """
179
+ - bash bin/my-append-script.sh
180
+ """
181
+ And a community-command/travis-append.yml file:
182
+ """
183
+
184
+ addons:
185
+ apt:
186
+ packages:
187
+ - ghostscript
188
+ """
189
+
190
+ When I run `wp scaffold package-tests community-command`
191
+ Then STDOUT should not be empty
192
+ And the community-command/.travis.yml file should exist
193
+ And the community-command/.travis.yml file should contain:
194
+ """
195
+ - $HOME/.composer/cache
196
+ """
197
+ And the community-command/.travis.yml file should contain:
198
+ """
199
+ - $HOME/my-append-cache
200
+
201
+ env:
202
+ """
203
+ And the community-command/.travis.yml file should contain:
204
+ """
205
+ - PATH="$TRAVIS_BUILD_DIR/vendor/bin:$PATH"
206
+ """
207
+ And the community-command/.travis.yml file should contain:
208
+ """
209
+ - MY_APPEND_ENV="my-append-env"
210
+
211
+ matrix:
212
+ """
213
+ And the community-command/.travis.yml file should contain:
214
+ """
215
+ - php: 7.2
216
+ """
217
+ And the community-command/.travis.yml file should contain:
218
+ """
219
+ - php: 99.97
220
+ env: WP_VERSION=9997.9997
221
+
222
+ before_install:
223
+ """
224
+ And the community-command/.travis.yml file should contain:
225
+ """
226
+ # Remove Xdebug
227
+ """
228
+ And the community-command/.travis.yml file should contain:
229
+ """
230
+ - bash bin/my-append-before_install.sh
231
+ - php -m
232
+
233
+ install:
234
+ """
235
+ And the community-command/.travis.yml file should contain:
236
+ """
237
+ - bash bin/install-package-tests.sh
238
+ """
239
+ And the community-command/.travis.yml file should contain:
240
+ """
241
+ - bash bin/my-append-install.sh
242
+
243
+ before_script:
244
+ """
245
+ And the community-command/.travis.yml file should contain:
246
+ """
247
+ - composer validate
248
+ """
249
+ And the community-command/.travis.yml file should contain:
250
+ """
251
+ - bash bin/my-append-before_script.sh
252
+
253
+ script:
254
+ """
255
+ And the community-command/.travis.yml file should contain:
256
+ """
257
+ - bash bin/test.sh
258
+ - bash bin/my-append-script.sh
259
+ """
260
+ And the community-command/.travis.yml file should contain:
261
+ """
262
+
263
+ addons:
264
+ apt:
265
+ packages:
266
+ - ghostscript
267
+ """
268
+
269
+ Given a community-command/travis-cache.yml file:
270
+ """
271
+ cache:
272
+ directories:
273
+ - $HOME/my-overwrite-cache
274
+ """
275
+ And a community-command/travis-env.yml file:
276
+ """
277
+ env:
278
+ global:
279
+ - MY_OVERWRITE_ENV="my-overwrite-env"
280
+ """
281
+ And a community-command/travis-matrix.yml file:
282
+ """
283
+ matrix:
284
+ include:
285
+ - php: 99.99
286
+ env: WP_VERSION=9999.9999
287
+ - php: 99.98
288
+ env: WP_VERSION=9999.9998
289
+ """
290
+ And a community-command/travis-before_install.yml file:
291
+ """
292
+ before_install:
293
+ - bash bin/my-overwrite-before_install.sh
294
+ """
295
+ And a community-command/travis-install.yml file:
296
+ """
297
+ install:
298
+ - bash bin/my-overwrite-install.sh
299
+ - bash bin/my-overwrite-install2.sh
300
+ """
301
+ And a community-command/travis-before_script.yml file:
302
+ """
303
+ before_script:
304
+ - bash bin/my-overwrite-before_script.sh
305
+ """
306
+ And a community-command/travis-script.yml file:
307
+ """
308
+ script:
309
+ - bash bin/my-overwrite-script.sh
310
+ """
311
+
312
+ When I try `wp scaffold package-tests community-command --force`
313
+ Then STDOUT should not be empty
314
+ And the community-command/.travis.yml file should exist
315
+ And the community-command/.travis.yml file should contain:
316
+ """
317
+ cache:
318
+ directories:
319
+ - $HOME/my-overwrite-cache
320
+
321
+ env:
322
+ global:
323
+ - MY_OVERWRITE_ENV="my-overwrite-env"
324
+
325
+ matrix:
326
+ include:
327
+ - php: 99.99
328
+ env: WP_VERSION=9999.9999
329
+ - php: 99.98
330
+ env: WP_VERSION=9999.9998
331
+
332
+ before_install:
333
+ - bash bin/my-overwrite-before_install.sh
334
+
335
+ install:
336
+ - bash bin/my-overwrite-install.sh
337
+ - bash bin/my-overwrite-install2.sh
338
+
339
+ before_script:
340
+ - bash bin/my-overwrite-before_script.sh
341
+
342
+ script:
343
+ - bash bin/my-overwrite-script.sh
344
+ """
345
+ And the community-command/.travis.yml file should contain:
346
+ """
347
+
348
+ addons:
349
+ apt:
350
+ packages:
351
+ - ghostscript
352
+ """
353
+ # `travis-matrix.yml` overrides `travis-matrix-append.yml`.
354
+ And the community-command/.travis.yml file should not contain:
355
+ """
356
+ 9997
357
+ """
358
+ # `travis-<tag>.yml` overrides `travis-<tag>-append.yml`.
359
+ And the community-command/.travis.yml file should not contain:
360
+ """
361
+ my-append
362
+ """
363
+ # `travis-cache.yml` overrides standard generated content.
364
+ And the community-command/.travis.yml file should not contain:
365
+ """
366
+ .composer
367
+ """
368
+ # `travis-env.yml` overrides standard generated content.
369
+ And the community-command/.travis.yml file should not contain:
370
+ """
371
+ WP_CLI_BIN_DIR
372
+ """
373
+ # `travis-matrix.yml` overrides standard generated content.
374
+ And the community-command/.travis.yml file should not contain:
375
+ """
376
+ 7.2
377
+ """
378
+ # `travis-before_install.yml` overrides standard generated content.
379
+ And the community-command/.travis.yml file should not contain:
380
+ """
381
+ # Remove Xdebug
382
+ """
383
+ # `travis-install/before_script.yml` overrides standard generated content.
384
+ And the community-command/.travis.yml file should not contain:
385
+ """
386
+ composer
387
+ """
388
+ # `travis-script.yml` overrides standard generated content.
389
+ And the community-command/.travis.yml file should not contain:
390
+ """
391
+ bin/test.sh
392
+ """
393
+ And STDERR should contain:
394
+ """
395
+ Warning: File already exists
396
+ """
397
+ And the return code should be 0
0 commit comments