Skip to content

Commit

Permalink
Fix return code comparisons
Browse files Browse the repository at this point in the history
  • Loading branch information
schlessera committed Apr 19, 2019
1 parent 68ccf63 commit f75bae4
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 f75bae4

Please sign in to comment.