Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: added negative test case
  • Loading branch information
iDschepe committed Jun 13, 2024
commit fc021e03fd0a783e9ab195a82d4ee09458df7641
21 changes: 16 additions & 5 deletions features/checksum-core.feature
Original file line number Diff line number Diff line change
Expand Up @@ -231,15 +231,11 @@ Feature: Validate checksums for WordPress install

Scenario: Verify core checksums with excluded files
Given a WP install
And "WordPress" replaced with "Wordpress" in the readme.html file
And "WordPress" replaced with "PressWord" in the readme.html file
And a wp-includes/some-filename.php file:
"""
sample content of some file
"""
And a readme.html file:
"""
# You really should read me
"""

When I try `wp core verify-checksums --exclude='readme.html wp-includes/some-filename.php'`
Then STDERR should be empty
Expand All @@ -249,3 +245,18 @@ Feature: Validate checksums for WordPress install
"""
And the return code should be 0

Scenario: Verify core checksums with missing one excluded file
Given a WP install
And "WordPress" replaced with "PressWord" in the readme.html file
And a wp-includes/some-filename.php file:
"""
sample content of some file
"""

When I try `wp core verify-checksums --exclude=' wp-includes/some-filename.php'`
Then STDERR should be:
"""
Warning: File doesn't verify against checksum: readme.html
Error: WordPress installation doesn't verify against checksums.
"""
And the return code should be 1