You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: features/checksum-core.feature
+119Lines changed: 119 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -260,3 +260,122 @@ Feature: Validate checksums for WordPress install
260
260
Error: WordPress installation doesn't verify against checksums.
261
261
"""
262
262
And the return code should be 1
263
+
264
+
Scenario: Core checksums verify with format parameter
265
+
Given a WP install
266
+
And "WordPress" replaced with "Modified WordPress" in the wp-includes/version.php file
267
+
And a wp-includes/extra-file.txt file:
268
+
"""
269
+
This is an extra file
270
+
"""
271
+
And "WordPress" replaced with "PressWord" in the readme.html file
272
+
273
+
When I try `wp core verify-checksums --format=json`
274
+
Then STDOUT should be:
275
+
"""
276
+
[{"file":"readme.html","message":"File doesn't verify against checksum"},{"file":"wp-includes\/version.php","message":"File doesn't verify against checksum"},{"file":"wp-includes\/extra-file.txt","message":"File should not exist"}]
277
+
"""
278
+
And STDERR should be:
279
+
"""
280
+
Error: WordPress installation doesn't verify against checksums.
281
+
"""
282
+
And the return code should be 1
283
+
284
+
Scenario: Core checksums verify with table format
285
+
Given a WP install
286
+
And "WordPress" replaced with "Modified" in the wp-includes/functions.php file
287
+
288
+
When I try `wp core verify-checksums --format=table`
Error: WordPress installation doesn't verify against checksums.
321
+
"""
322
+
And the return code should be 1
323
+
324
+
Scenario: Core checksums verify format parameter with multiple file types
325
+
Given a WP install
326
+
And "Version" replaced with "v" in the wp-includes/version.php file
327
+
And I run `rm wp-includes/nav-menu.php`
328
+
And a wp-includes/extra.txt file:
329
+
"""
330
+
test file
331
+
"""
332
+
333
+
When I try `wp core verify-checksums --format=json`
334
+
Then STDOUT should contain:
335
+
"""
336
+
[{"file":"wp-includes\/nav-menu.php","message":"File doesn't exist"},{"file":"wp-includes\/version.php","message":"File doesn't verify against checksum"},{"file":"wp-includes\/extra.txt","message":"File should not exist"}]
337
+
"""
338
+
And the return code should be 1
339
+
340
+
Scenario: Core checksums verify with count format
341
+
Given a WP install
342
+
And "WordPress" replaced with "Modified" in the wp-includes/post.php file
343
+
And I run `rm wp-includes/comment.php`
344
+
And a wp-includes/test.txt file:
345
+
"""
346
+
test content
347
+
"""
348
+
349
+
When I try `wp core verify-checksums --format=count`
350
+
Then STDOUT should be:
351
+
"""
352
+
3
353
+
"""
354
+
And the return code should be 1
355
+
356
+
Scenario: Core checksums verify with format parameter and excluded files
357
+
Given a WP install
358
+
And "WordPress" replaced with "Modified" in the wp-includes/update.php file
359
+
And "WordPress" replaced with "Changed" in the wp-includes/meta.php file
360
+
And a wp-includes/test.log file:
361
+
"""
362
+
log content
363
+
"""
364
+
365
+
When I try `wp core verify-checksums --format=json --exclude=wp-includes/meta.php,wp-includes/test.log`
366
+
Then STDOUT should contain:
367
+
"""
368
+
[{"file":"wp-includes\/update.php","message":"File doesn't verify against checksum"}]
369
+
"""
370
+
And the return code should be 1
371
+
372
+
Scenario: Core checksums verify format parameter with empty result after exclusion
373
+
Given a WP install
374
+
And "WordPress" replaced with "Changed" in the wp-includes/cache.php file
375
+
376
+
When I try `wp core verify-checksums --format=json --exclude=wp-includes/cache.php`
377
+
Then STDOUT should be:
378
+
"""
379
+
Success: WordPress installation verifies against checksums.
0 commit comments