Skip to content

Commit

Permalink
Merge pull request #61 from wp-cli/fix-return-code-comparisons
Browse files Browse the repository at this point in the history
Fix return code comparisons
  • Loading branch information
schlessera authored Apr 19, 2019
2 parents 68ccf63 + f75bae4 commit a6a3ef6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion features/steps/then.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
$steps->Then(
'/^the return code should( not)? be (\d+)$/',
function ( $world, $not, $return_code ) {
if ( ( ! $not && $return_code !== $world->result->return_code ) || ( $not && $return_code === $world->result->return_code ) ) {
if (
( ! $not && (int) $return_code !== $world->result->return_code )
|| ( $not && (int) $return_code === $world->result->return_code )
) {
throw new RuntimeException( $world->result );
}
}
Expand Down

0 comments on commit a6a3ef6

Please sign in to comment.