Skip to content

Commit 0c73cea

Browse files
authored
Update src/Context/WhenStepDefinitions.php
1 parent d621848 commit 0c73cea

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/Context/WhenStepDefinitions.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@ public function wpcli_tests_invoke_proc( $proc, $mode ) {
2424
} catch ( \RuntimeException $e ) {
2525
if ( 'run' === $mode ) {
2626
$message = $e->getMessage();
27-
$status = 'unknown';
28-
if ( preg_match( '/exit status: (\d+)$/', $message, $matches ) ) {
29-
$status = $matches[1];
30-
}
27+
$status = preg_match( '/exit status: (\d+)$/', $message, $matches ) ? $matches[1] : 'unknown';
3128

3229
if ( '0' === $status ) {
3330
$message .= "\n\nThe command unexpectedly produced STDERR output. If you expect a non-zero exit status or STDERR output, use `When I try [...]`. Else, this may be a bug in your code or test.";

0 commit comments

Comments
 (0)