You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e4afd39
Browse filesBrowse the repository at this point in the historyBrowse files
&& ! preg_match( "/'([A-Za-z0-9_.+-]+)' is not recognized as an internal or external command/", $stderr, $matches )
32
+
) {
33
+
return'';
34
+
}
35
+
36
+
return"\n\nThe command `{$matches[1]}` was not found. If the scenario needs it, tag it with @require-bin-{$matches[1]}, so that environments without it report the scenario as not run instead of failing it.";
Copy file name to clipboardExpand all lines: src/Context/WhenStepDefinitions.php
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,8 @@ public function wpcli_tests_invoke_proc( $proc, $mode ) {
32
32
$message .= "\n\nThe command unexpectedly exited with status {$status}. If you expect a non-zero exit status, use `When I try [...]`. Else, this may be a bug in your code or test.";
"Feature: Commands\n\n @require-bin-wpclinonexistentcommand\n Scenario: Needs a missing command\n Given a step\n\n @require-bin-php\n Scenario: Needs PHP\n Given a step\n"
$this->assertStringContainsString( '@require-bin-wpclinonexistentcommand, as the command "wpclinonexistentcommand" is not available: ', $result['stderr'] );
$this->assertStringContainsString( 'Warning: @require-wpclinonexistent is not a known requirement and does not filter anything: ', $result['stderr'] );
$this->assertStringContainsString( "The command `{$command}` was not found. If the scenario needs it, tag it with @require-bin-{$command}", $this->hint( $stderr ) );
fwrite( STDERR, sprintf( "Warning: %s is not a known requirement and does not filter anything: %s\n", $tag, implode( ', ', array_unique( $paths ) ) ) );
473
+
}
474
+
}
475
+
396
476
/**
397
477
* Get the scenarios of the feature files with the tags that apply to them.
398
478
*
@@ -457,6 +537,22 @@ function describe_skip_tag( $tag, $context ) {
457
537
returnarray( true, "the PHP extension \"{$matches[1]}\" is not loaded" );
458
538
}
459
539
540
+
if ( preg_match( '/^@require-bin-(.+)$/', $tag, $matches ) ) {
541
+
returnarray( true, "the command \"{$matches[1]}\" is not available" );
542
+
}
543
+
544
+
if ( '@require-composer' === $tag ) {
545
+
returnarray( true, 'the command "composer" is not available' );
546
+
}
547
+
548
+
if ( '@require-download' === $tag ) {
549
+
returnarray( true, 'downloads.wordpress.org cannot be reached' );
550
+
}
551
+
552
+
if ( '@require-opcache-save-comments' === $tag ) {
0 commit comments