@@ -19,7 +19,7 @@ protected function set_up(): void {
1919
2020 $ this ->temp_dir = Utils \get_temp_dir () . uniqid ( 'wp-cli-test-behat-tags- ' , true );
2121 mkdir ( $ this ->temp_dir );
22- mkdir ( $ this ->temp_dir . ' / features ' );
22+ mkdir ( $ this ->temp_dir . DIRECTORY_SEPARATOR . ' features ' );
2323 }
2424
2525 protected function tear_down (): void {
@@ -71,7 +71,7 @@ private function run_behat_tags_script( $env = '' ) {
7171 $ command = '' ;
7272 if ( ! empty ( $ env ) ) {
7373 // putenv() can be unreliable. Prepending the variable to the command is more robust.
74- if ( DIRECTORY_SEPARATOR === '\\' ) { // Windows
74+ if ( Utils \is_windows () ) {
7575 // `set` is internal to `cmd.exe`. Do not escape the $env variable, as it's from a trusted
7676 // data provider and `escapeshellarg` adds quotes that `set` doesn't understand.
7777 // Note: `set "VAR=VALUE"` is more robust than `set VAR=VALUE`.
@@ -104,7 +104,7 @@ public function test_behat_tags_wp_version_github_token( $env, $expected ): void
104104 putenv ( 'GITHUB_TOKEN ' );
105105
106106 $ 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 ' ;
107- file_put_contents ( $ this ->temp_dir . ' / features/ wp_version.feature ' , $ contents );
107+ file_put_contents ( $ this ->temp_dir . DIRECTORY_SEPARATOR . ' features ' . DIRECTORY_SEPARATOR . ' wp_version.feature ' , $ contents );
108108
109109 $ output = $ this ->run_behat_tags_script ( $ env );
110110
@@ -212,7 +212,7 @@ public function test_behat_tags_php_version(): void {
212212 break ;
213213 }
214214
215- file_put_contents ( $ this ->temp_dir . ' / features/ php_version.feature ' , $ contents );
215+ file_put_contents ( $ this ->temp_dir . DIRECTORY_SEPARATOR . ' features ' . DIRECTORY_SEPARATOR . ' php_version.feature ' , $ contents );
216216
217217 $ output = $ this ->run_behat_tags_script ();
218218 $ this ->assertSame ( '--tags= ' . $ expected , $ output );
@@ -226,7 +226,7 @@ public function test_behat_tags_extension(): void {
226226
227227 putenv ( 'GITHUB_TOKEN ' );
228228
229- file_put_contents ( $ this ->temp_dir . ' / features/ extension.feature ' , '@require-extension-imagick @require-extension-curl ' );
229+ file_put_contents ( $ this ->temp_dir . DIRECTORY_SEPARATOR . ' features ' . DIRECTORY_SEPARATOR . ' extension.feature ' , '@require-extension-imagick @require-extension-curl ' );
230230
231231 $ expecteds = array ();
232232
@@ -304,7 +304,7 @@ public function test_behat_tags_db_version(): void {
304304 break ;
305305 }
306306
307- file_put_contents ( $ this ->temp_dir . ' / features/ extension.feature ' , $ contents );
307+ file_put_contents ( $ this ->temp_dir . DIRECTORY_SEPARATOR . ' features ' . DIRECTORY_SEPARATOR . ' extension.feature ' , $ contents );
308308
309309 $ expected = '--tags= ' . implode ( '&& ' , array_merge ( array ( '~@github-api ' , '~@broken ' ), $ expecteds ) );
310310 $ output = $ this ->run_behat_tags_script ();
0 commit comments