diff --git a/report.php b/report.php index 1a15d6c..cec931e 100644 --- a/report.php +++ b/report.php @@ -49,7 +49,7 @@ * safely used in shell commands. */ log_message('Copying junit.xml results'); -$junit_location = escapeshellarg( $runner_vars['WPT_TEST_DIR'] ) . '/tests/phpunit/build/logs/*'; +$junit_location = $runner_vars['WPT_TEST_DIR'] . '/tests/phpunit/build/logs/*'; /** * Modifies the junit.xml results file path for a remote location if an SSH connection is available. @@ -58,8 +58,8 @@ * command and options for accessing the remote file system. It concatenates SSH options with the * remote path to ensure that the junit.xml results can be accessed or copied over SSH. */ -if ( ! empty( $runner_vars['WPT_SSH_CONNECT'] ) ) { - $junit_location = '-e "ssh ' . $runner_vars['WPT_SSH_OPTIONS'] . '" ' . escapeshellarg( $runner_vars['WPT_SSH_CONNECT'] . ':' . $junit_location ); +if ( ! empty( $WPT_SSH_CONNECT ) ) { + $junit_location = '-e "ssh ' . $runner_vars['WPT_SSH_OPTIONS'] . '" ' . escapeshellarg( $runner_vars['WPT_SSH_CONNECT'] ) . ':' . escapeshellarg( $junit_location ); } /** diff --git a/test.php b/test.php index c2b56c7..25b150e 100644 --- a/test.php +++ b/test.php @@ -65,13 +65,15 @@ * avoid reporting useless tests. */ $WPT_PHPUNIT_CMD = trim( getenv( 'WPT_PHPUNIT_CMD' ) ); -if( empty( $WPT_PHPUNIT_CMD ) ) { - $WPT_PHPUNIT_CMD = 'cd ' . escapeshellarg( $runner_vars['WPT_TEST_DIR'] ) . ' && ' . $runner_vars['WPT_PHP_EXECUTABLE'] . ' ./vendor/phpunit/phpunit/phpunit --dont-report-useless-tests' . $WPT_FLAVOR_TXT . $WPT_EXTRATESTS_TXT; +if ( empty( $WPT_PHPUNIT_CMD ) ) { + $WPT_PHPUNIT_CMD = escapeshellarg( 'cd ' . $runner_vars['WPT_TEST_DIR'] ) . ' && ' . $runner_vars['WPT_PHP_EXECUTABLE'] . ' ./vendor/phpunit/phpunit/phpunit --dont-report-useless-tests' . $WPT_FLAVOR_TXT . $WPT_EXTRATESTS_TXT ); +} else { + $WPT_PHPUNIT_CMD = escapeshellarg( $WPT_PHPUNIT_CMD ); } // If an SSH connection string is provided, prepend the SSH command to the PHPUnit execution command. if ( ! empty( $runner_vars['WPT_SSH_CONNECT'] ) ) { - $WPT_PHPUNIT_CMD = 'ssh ' . $runner_vars['WPT_SSH_OPTIONS'] . ' ' . escapeshellarg( $runner_vars['WPT_SSH_CONNECT'] ) . ' ' . escapeshellarg( $WPT_PHPUNIT_CMD ); + $WPT_PHPUNIT_CMD = 'ssh ' . $runner_vars['WPT_SSH_OPTIONS'] . ' ' . escapeshellarg( $runner_vars['WPT_SSH_CONNECT'] ) . ' ' . $WPT_PHPUNIT_CMD; } // Execute the PHPUnit command.