Skip to content

Commit

Permalink
Test realpath
Browse files Browse the repository at this point in the history
  • Loading branch information
ernilambar committed Sep 9, 2024
1 parent 9d72214 commit 1d5c709
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions includes/Plugin_Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ public function __construct( $main_file ) {
);
}

$this->main_file = realpath( $this->main_file );

if ( false === strpos( $this->main_file, '.php' ) ) {
$files = glob( $this->main_file . '/*.php' );
foreach ( $files as $file ) {
Expand Down
4 changes: 4 additions & 0 deletions tests/behat/features/plugin-check-remote.feature
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ Feature: Test that the WP-CLI plugin check command works with remote ZIP url.
Scenario: Test with valid ZIP
When I run the WP-CLI command `plugin check https://github.com/WordPress/plugin-check/raw/trunk/tests/behat/testdata/foo-bar-wp.zip --fields=code,type --format=csv`
Then STDOUT should contain:
"""
FILE: foo-bar-wp.php
"""
And STDOUT should contain:
"""
WordPress.WP.AlternativeFunctions.rand_mt_rand,ERROR
"""
Expand Down

0 comments on commit 1d5c709

Please sign in to comment.