Feature: `wp cli` tasks @less-than-php-8 Scenario: Ability to detect a WP-CLI registered command Given a WP installation # Allow for composer/ca-bundle using `openssl_x509_parse()` which throws PHP warnings on old versions of PHP. When I try `wp package install wp-cli/scaffold-package-command` And I run `wp cli has-command scaffold package` Then the return code should be 0 # Allow for composer/ca-bundle using `openssl_x509_parse()` which throws PHP warnings on old versions of PHP. When I try `wp package uninstall wp-cli/scaffold-package-command` And I try `wp cli has-command scaffold package` Then the return code should be 1 Scenario: Ability to detect a command which is registered by plugin Given a WP installation And a wp-content/mu-plugins/test-cli.php file: """ * : Configuration parameter name to check for. * * @when after_wp_load */ public function __invoke( $args ) { if ( WP_CLI::has_config( $args[0] ) ) { WP_CLI::log( "Global configuration '{$args[0]}' does exist." ); } else { WP_CLI::log( "Global configuration '{$args[0]}' does not exist." ); } } } WP_CLI::add_command( 'custom-command', 'Custom_Command' ); """ When I run `wp --require=custom-cmd.php custom-command url` Then STDOUT should be: """ Global configuration 'url' does exist. """ When I run `wp --require=custom-cmd.php custom-command dummy` Then STDOUT should be: """ Global configuration 'dummy' does not exist. """