Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add strict mode to string comparisons for files #132

Merged
merged 1 commit into from
Jul 26, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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