Skip to content

Commit f75bae4

Browse files
committed
Fix return code comparisons
1 parent 68ccf63 commit f75bae4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

features/steps/then.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
$steps->Then(
88
'/^the return code should( not)? be (\d+)$/',
99
function ( $world, $not, $return_code ) {
10-
if ( ( ! $not && $return_code !== $world->result->return_code ) || ( $not && $return_code === $world->result->return_code ) ) {
10+
if (
11+
( ! $not && (int) $return_code !== $world->result->return_code )
12+
|| ( $not && (int) $return_code === $world->result->return_code )
13+
) {
1114
throw new RuntimeException( $world->result );
1215
}
1316
}

0 commit comments

Comments
 (0)