Skip to content

Commit ef13e97

Browse files
committed
fix abs path check
1 parent 52dec36 commit ef13e97

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Context/ThenStepDefinitions.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,8 +455,10 @@ public function then_stdout_stderr_should_be_a_specific_version_string( $stream,
455455
public function then_a_specific_file_folder_should_exist( $path, $type, $strictly, $action, $expected = null ): void {
456456
$path = $this->replace_variables( $path );
457457

458+
$is_absolute = preg_match( '#^[a-zA-Z]:\\\\#', $path ) || ( '/' === $path[0] || '\\' === $path[0] );
459+
458460
// If it's a relative path, make it relative to the current test dir.
459-
if ( DIRECTORY_SEPARATOR !== $path[0] && 0 !== strpos( $path, $this->variables['RUN_DIR'] ) ) {
461+
if ( ! $is_absolute ) {
460462
$path = $this->variables['RUN_DIR'] . DIRECTORY_SEPARATOR . $path;
461463
}
462464

0 commit comments

Comments
 (0)