Skip to content

Commit

Permalink
Merge pull request #840 from WordPress/duplicated-message-file-type-c…
Browse files Browse the repository at this point in the history
…heck

Duplicated message for file type check
  • Loading branch information
davidperezgar authored Dec 20, 2024
2 parents 012db17 + 28d9802 commit 46f3018
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion includes/Checker/Checks/Plugin_Repo/File_Type_Check.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ protected function look_for_hidden_files( Check_Result $result, array $files ) {
protected function look_for_application_files( Check_Result $result, array $files ) {
$application_files = self::filter_files_by_extensions(
$files,
array( 'a', 'bin', 'bpk', 'deploy', 'dist', 'distz', 'dmg', 'dms', 'DS_Store', 'dump', 'elc', 'exe', 'iso', 'lha', 'lrf', 'lzh', 'o', 'obj', 'phar', 'pkg', 'sh', 'so' )
array( 'a', 'bin', 'bpk', 'deploy', 'dist', 'distz', 'dmg', 'dms', 'dump', 'elc', 'exe', 'iso', 'lha', 'lrf', 'lzh', 'o', 'obj', 'phar', 'pkg', 'sh', 'so' )
);
if ( $application_files ) {
foreach ( $application_files as $file ) {
Expand Down
31 changes: 31 additions & 0 deletions tests/behat/features/plugin-check.feature
Original file line number Diff line number Diff line change
Expand Up @@ -719,3 +719,34 @@ Feature: Test that the WP-CLI command works.
"""
readme_invalid_contributors
"""

Scenario: Check duplicated error messages for hidden files and application files
Given a WP install with the Plugin Check plugin
And a wp-content/plugins/foo-sample/foo-sample.php file:
"""
<?php
/**
* Plugin Name: Foo Sample
* Plugin URI: https://foo-sample.com
* Description: Custom plugin.
* Version: 0.1.0
* Author: WordPress Performance Team
* Author URI: https://make.wordpress.org/performance/
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
*/
"""
And a wp-content/plugins/foo-sample/.DS_Store file:
"""
"""

When I run the WP-CLI command `plugin check foo-sample --checks=file_type`
Then STDOUT should contain:
"""
hidden_files
"""
And STDOUT should not contain:
"""
application_detected
"""

0 comments on commit 46f3018

Please sign in to comment.