Skip to content

Commit a6a3ef6

Browse files
authored
Merge pull request #61 from wp-cli/fix-return-code-comparisons
Fix return code comparisons
2 parents 68ccf63 + f75bae4 commit a6a3ef6

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)