Skip to content

Commit 0a5ab90

Browse files
committed
Try Windows workaround for unit tests
1 parent 3ad0ed8 commit 0a5ab90

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/tests/TestBehatTags.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,14 @@ public function test_behat_tags_wp_version_github_token( $env, $expected ): void
5555
$contents = '@require-wp-4.6 @require-wp-4.8 @require-wp-4.9 @less-than-wp-4.6 @less-than-wp-4.8 @less-than-wp-4.9';
5656
file_put_contents( $this->temp_dir . '/features/wp_version.feature', $contents );
5757

58-
$output = exec( "cd {$this->temp_dir}; $env php $behat_tags" );
58+
if ( ! empty( $env ) ) {
59+
putenv( $env );
60+
}
61+
$output = exec( 'cd ' . escapeshellarg( $this->temp_dir ) . ' && php ' . escapeshellarg( $behat_tags ) );
62+
if ( ! empty( $env ) ) {
63+
list( $key ) = explode( '=', $env, 2 );
64+
putenv( $key );
65+
}
5966

6067
$expected .= '&&~@broken';
6168
if ( in_array( $env, array( 'WP_VERSION=trunk', 'WP_VERSION=nightly' ), true ) ) {

0 commit comments

Comments
 (0)