Skip to content

Commit

Permalink
Merge pull request #132 from wp-cli/add/strict-string-comparisons-for…
Browse files Browse the repository at this point in the history
…-files

Add strict mode to string comparisons for files
  • Loading branch information
schlessera authored Jul 26, 2021
2 parents 71ea911 + 0d65427 commit c10e6d7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Context/ThenStepDefinitions.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,9 @@ public function then_stdout_stderr_should_be_a_specific_version_string( $stream,
}

/**
* @Then /^the (.+) (file|directory) should (exist|not exist|be:|contain:|not contain:)$/
* @Then /^the (.+) (file|directory) should( strictly)? (exist|not exist|be:|contain:|not contain:)$/
*/
public function then_a_specific_file_folder_should_exist( $path, $type, $action, $expected = null ) {
public function then_a_specific_file_folder_should_exist( $path, $type, $strictly, $action, $expected = null ) {
$path = $this->replace_variables( $path );

// If it's a relative path, make it relative to the current test dir.
Expand Down Expand Up @@ -235,7 +235,7 @@ public function then_a_specific_file_folder_should_exist( $path, $type, $action,
}
$contents = implode( PHP_EOL, $files );
}
$this->check_string( $contents, $expected, $action );
$this->check_string( $contents, $expected, $action, false, (bool) $strictly );
}
}

Expand Down

0 comments on commit c10e6d7

Please sign in to comment.