Skip to content

Commit 5944bbd

Browse files
committed
Consider the single case of running from the wp-cli-tests project itself
Where this file is not vendored
1 parent 35e86e4 commit 5944bbd

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/Context/FeatureContext.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -705,8 +705,15 @@ public function get_command_with_coverage( $cmd ) {
705705

706706
$modify_command = function ( $part ) {
707707
if ( preg_match( '/(^wp )|( wp )|(\/wp )/', $part ) ) {
708-
$part = preg_replace( '/(^wp )|( wp )|(\/wp )/', '$1$2$3', $part );
709-
$part .= ' --require={TEST_RUN_DIR}/vendor/wp-cli/wp-cli-tests/utils/generate-coverage.php';
708+
$part = preg_replace( '/(^wp )|( wp )|(\/wp )/', '$1$2$3', $part );
709+
710+
$require_path = '{TEST_RUN_DIR}/vendor/wp-cli/wp-cli-tests/utils/generate-coverage.php';
711+
if ( ! file_exists( $this->variables['TEST_RUN_DIR'] . '/vendor/wp-cli/wp-cli-tests/utils/generate-coverage.php' ) ) {
712+
// This file is not vendored inside the wp-cli-tests project
713+
$require_path = '{TEST_RUN_DIR}/utils/generate-coverage.php';
714+
}
715+
$part .= " --require={$require_path}";
716+
710717
}
711718
return $part;
712719
};

0 commit comments

Comments
 (0)