Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
24 changes: 0 additions & 24 deletions features/checksum-plugin.feature
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,6 @@ Feature: Validate checksums for WordPress plugins
"""
And STDERR should be empty

When I try `wp plugin verify-checksums duplicate-post --format=json --version=3.2.2`
Then the return code should be 1
And STDOUT should contain:
"""
"plugin_name":"duplicate-post","file":"duplicate-post-jetpack.php","message":"File is missing"
"""
And STDERR should be:
"""
Error: No plugins verified (1 failed).
"""

Scenario: Modified plugin doesn't verify
Given a WP install

Expand All @@ -50,19 +39,6 @@ Feature: Validate checksums for WordPress plugins
Error: No plugins verified (1 failed).
"""

When I run `rm wp-content/plugins/duplicate-post/duplicate-post.css`
Then STDERR should be empty

When I try `wp plugin verify-checksums duplicate-post --format=json`
Then STDOUT should contain:
"""
"plugin_name":"duplicate-post","file":"duplicate-post.css","message":"File is missing"
"""
And STDERR should be:
"""
Error: No plugins verified (1 failed).
"""

When I run `touch wp-content/plugins/duplicate-post/additional-file.php`
Then STDERR should be empty

Expand Down
6 changes: 0 additions & 6 deletions src/Checksum_Plugin_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,6 @@ public function __invoke( $args, $assoc_args ) {

$files = $this->get_plugin_files( $plugin->file );

foreach ( $checksums as $file => $checksum_array ) {
if ( ! in_array( $file, $files, true ) ) {
$this->add_error( $plugin->name, $file, 'File is missing' );
}
}

foreach ( $files as $file ) {
if ( ! array_key_exists( $file, $checksums ) ) {
$this->add_error( $plugin->name, $file, 'File was added' );
Expand Down