Skip to content

Commit e28fa88

Browse files
committed
Try using DIRECTORY_SEPARATOR
1 parent f138f6b commit e28fa88

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Context/FeatureContext.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1042,7 +1042,7 @@ private static function get_event_file( $scope, &$line ): ?string {
10421042
*/
10431043
public function create_run_dir(): void {
10441044
if ( ! isset( $this->variables['RUN_DIR'] ) ) {
1045-
self::$run_dir = sys_get_temp_dir() . '/' . uniqid( 'wp-cli-test-run-' . self::$temp_dir_infix . '-', true );
1045+
self::$run_dir = sys_get_temp_dir() . DIRECTORY_SEPARATOR . uniqid( 'wp-cli-test-run-' . self::$temp_dir_infix . '-', true );
10461046
$this->variables['RUN_DIR'] = self::$run_dir;
10471047
mkdir( $this->variables['RUN_DIR'] );
10481048
}

src/Context/ThenStepDefinitions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,8 +456,8 @@ public function then_a_specific_file_folder_should_exist( $path, $type, $strictl
456456
$path = $this->replace_variables( $path );
457457

458458
// If it's a relative path, make it relative to the current test dir.
459-
if ( '/' !== $path[0] ) {
460-
$path = $this->variables['RUN_DIR'] . "/$path";
459+
if ( DIRECTORY_SEPARATOR !== $path[0] ) {
460+
$path = $this->variables['RUN_DIR'] . DIRECTORY_SEPARATOR . $path;
461461
}
462462

463463
$exists = static function ( $path ) use ( $type ) {

0 commit comments

Comments
 (0)