From c65cc5737689da3d3faf2f3c4a3491bd79bf90c9 Mon Sep 17 00:00:00 2001 From: Alain Schlesser Date: Fri, 30 Oct 2026 19:44:40 +0100 Subject: [PATCH] Test wp-cli/wp-cli-tests#397 Co-Authored-By: Claude Opus 5.5 --- composer.json | 2 +- features/install-wp-tests.feature | 12 ------------ features/scaffold-lint.feature | 4 ---- features/scaffold-plugin-tests.feature | 4 ---- features/scaffold-theme-tests.feature | 3 --- features/scaffold.feature | 19 ------------------- 6 files changed, 1 insertion(+), 43 deletions(-) diff --git a/composer.json b/composer.json index 5f6f1a1e..8707ed5b 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ }, "require-dev": { "wp-cli/extension-command": "^1.2 || ^2 || ^3", - "wp-cli/wp-cli-tests": "^5" + "wp-cli/wp-cli-tests": "dev-builtin-directory-variables as 5.3.99" }, "config": { "process-timeout": 7200, diff --git a/features/install-wp-tests.feature b/features/install-wp-tests.feature index d77ad606..6c076d14 100644 --- a/features/install-wp-tests.feature +++ b/features/install-wp-tests.feature @@ -5,8 +5,6 @@ Feature: Scaffold install-wp-tests.sh tests @skip-windows Scenario: Help should be displayed Given a WP install - And I run `wp plugin path` - And save STDOUT as {PLUGIN_DIR} And I run `wp scaffold plugin hello-world` When I try `/usr/bin/env bash {PLUGIN_DIR}/hello-world/bin/install-wp-tests.sh` @@ -48,8 +46,6 @@ Feature: Scaffold install-wp-tests.sh tests And I run `wp eval-file get-phpunit-phar-url.php --skip-wordpress` And save STDOUT as {PHPUNIT_PHAR_URL} And I run `curl -sS -L --fail -o phpunit {PHPUNIT_PHAR_URL}` - And I run `wp plugin path` - And save STDOUT as {PLUGIN_DIR} And I run `wp scaffold plugin hello-world` # This throws a warning for the password provided via command line. And I try `mysql -u{DB_USER} -p{DB_PASSWORD} -h{MYSQL_HOST} -P{MYSQL_PORT} --protocol=tcp -e "DROP DATABASE IF EXISTS wp_cli_test_scaffold"` @@ -166,8 +162,6 @@ Feature: Scaffold install-wp-tests.sh tests And I run `wp eval-file get-phpunit-phar-url.php --skip-wordpress` And save STDOUT as {PHPUNIT_PHAR_URL} And I run `curl -sS --fail -L -o phpunit {PHPUNIT_PHAR_URL}` - And I run `wp plugin path` - And save STDOUT as {PLUGIN_DIR} And I run `wp scaffold plugin hello-world` # This throws a warning for the password provided via command line. And I try `mysql -u{DB_USER} -p{DB_PASSWORD} -h{MYSQL_HOST} -P{MYSQL_PORT} --protocol=tcp -e "DROP DATABASE IF EXISTS wp_cli_test_scaffold"` @@ -296,8 +290,6 @@ Feature: Scaffold install-wp-tests.sh tests And I run `wp eval-file get-phpunit-phar-url.php --skip-wordpress` And save STDOUT as {PHPUNIT_PHAR_URL} And I run `curl -sS -L --fail -o phpunit {PHPUNIT_PHAR_URL}` - And I run `wp plugin path` - And save STDOUT as {PLUGIN_DIR} And I run `wp scaffold plugin hello-world` # This throws a warning for the password provided via command line. And I try `mysql -u{DB_USER} -p{DB_PASSWORD} -h{MYSQL_HOST} -P{MYSQL_PORT} --protocol=tcp -e "DROP DATABASE IF EXISTS wp_cli_test_scaffold"` @@ -406,8 +398,6 @@ Feature: Scaffold install-wp-tests.sh tests And I run `wp eval-file get-phpunit-phar-url.php --skip-wordpress` And save STDOUT as {PHPUNIT_PHAR_URL} And I run `curl -sS -f -L -o phpunit {PHPUNIT_PHAR_URL}` - And I run `wp plugin path` - And save STDOUT as {PLUGIN_DIR} And I run `wp scaffold plugin hello-world` # This throws a warning for the password provided via command line. And I try `mysql -u{DB_USER} -p{DB_PASSWORD} -h{MYSQL_HOST} -P{MYSQL_PORT} --protocol=tcp -e "DROP DATABASE IF EXISTS wp_cli_test_scaffold"` @@ -486,8 +476,6 @@ Feature: Scaffold install-wp-tests.sh tests @require-mysql Scenario: Install WordPress 3.7 and phpunit will not run Given a WP install - And I run `wp plugin path` - And save STDOUT as {PLUGIN_DIR} And I run `wp scaffold plugin hello-world` # This throws a warning for the password provided via command line. And I try `mysql -u{DB_USER} -p{DB_PASSWORD} -h{MYSQL_HOST} -P{MYSQL_PORT} --protocol=tcp -e "DROP DATABASE IF EXISTS wp_cli_test_scaffold"` diff --git a/features/scaffold-lint.feature b/features/scaffold-lint.feature index 2bc7c1b8..d03e2189 100644 --- a/features/scaffold-lint.feature +++ b/features/scaffold-lint.feature @@ -2,8 +2,6 @@ Feature: Lint scaffolded code Background: Given a WP install - And I run `wp plugin path` - And save STDOUT as {PLUGIN_DIR} # Create a helper plugin to install phpcs once for all scenarios When I run `wp scaffold plugin phpcs-helper --skip-tests` @@ -62,8 +60,6 @@ Feature: Lint scaffolded code Scenario: Scaffold child theme and lint it When I run `wp theme install twentytwentyone --force --activate` - And I run `wp theme path` - And save STDOUT as {THEME_DIR} And I run `wp scaffold child-theme test-child --parent_theme=twentytwentyone` Then STDOUT should not be empty diff --git a/features/scaffold-plugin-tests.feature b/features/scaffold-plugin-tests.feature index 4376b8da..64bdf14f 100644 --- a/features/scaffold-plugin-tests.feature +++ b/features/scaffold-plugin-tests.feature @@ -4,8 +4,6 @@ Feature: Scaffold plugin unit tests @skip-windows Scenario: Scaffold plugin tests Given a WP install - When I run `wp plugin path` - Then save STDOUT as {PLUGIN_DIR} When I run `wp scaffold plugin hello-world --skip-tests` Then STDOUT should not be empty @@ -342,8 +340,6 @@ Feature: Scaffold plugin unit tests Scenario: Accept bitbucket as valid CI in plugin scaffold Given a WP install - When I run `wp plugin path` - Then save STDOUT as {PLUGIN_DIR} When I run `wp scaffold plugin hello-world --ci=bitbucket` Then STDOUT should not be empty diff --git a/features/scaffold-theme-tests.feature b/features/scaffold-theme-tests.feature index d8756a5c..eaecd0a9 100644 --- a/features/scaffold-theme-tests.feature +++ b/features/scaffold-theme-tests.feature @@ -5,9 +5,6 @@ Feature: Scaffold theme unit tests And I try `wp theme install twentytwelve --force` And I run `wp scaffold child-theme t12child --parent_theme=twentytwelve` - When I run `wp theme path` - Then save STDOUT as {THEME_DIR} - @require-php-7.4 @require-mysql Scenario: Scaffold theme tests When I run `wp scaffold theme-tests t12child` diff --git a/features/scaffold.feature b/features/scaffold.feature index 4236e38a..7d804526 100644 --- a/features/scaffold.feature +++ b/features/scaffold.feature @@ -3,8 +3,6 @@ Feature: WordPress code scaffolding @theme Scenario: Scaffold a child theme Given a WP install - And I run `wp theme path` - And save STDOUT as {THEME_DIR} When I run `wp scaffold child-theme zombieland --parent_theme=umbrella --theme_name=Zombieland --author=Tallahassee --author_uri=https://wp-cli.org --theme_uri=http://www.zombieland.com` Then the {THEME_DIR}/zombieland/style.css file should exist @@ -21,8 +19,6 @@ Feature: WordPress code scaffolding Scenario: Scaffold a child theme with only --parent_theme parameter Given a WP install - And I run `wp theme path` - And save STDOUT as {THEME_DIR} When I run `wp scaffold child-theme hello-world --parent_theme=simple-life` Then STDOUT should not be empty @@ -68,9 +64,6 @@ Feature: WordPress code scaffolding When I run `wp theme install twentytwentyone --force` Then STDOUT should not be empty - And I run `wp theme path` - And save STDOUT as {THEME_DIR} - When I run `wp scaffold child-theme first-run --parent_theme=twentytwentyone --theme_name="First Run Name" --activate` Then STDOUT should contain: """ @@ -129,8 +122,6 @@ Feature: WordPress code scaffolding @theme Scenario: Scaffold a child theme with dots in the slug Given a WP install - And I run `wp theme path` - And save STDOUT as {THEME_DIR} When I run `wp scaffold child-theme my-theme-2.0.1 --parent_theme=umbrella` Then the {THEME_DIR}/my-theme-2.0.1/functions.php file should exist @@ -267,8 +258,6 @@ Feature: WordPress code scaffolding Scenario: Scaffold a plugin Given a WP install - And I run `wp plugin path` - And save STDOUT as {PLUGIN_DIR} And I run `wp core version` And save STDOUT as {WP_VERSION} @@ -403,8 +392,6 @@ Feature: WordPress code scaffolding @require-php-5.6 @require-wp-4.6 Scenario: Scaffold starter code for a theme Given a WP install - And I run `wp theme path` - And save STDOUT as {THEME_DIR} # Allow for warnings to be generated due to https://github.com/wp-cli/scaffold-command/issues/181 When I try `wp scaffold _s starter-theme` @@ -418,8 +405,6 @@ Feature: WordPress code scaffolding @require-php-5.6 @require-wp-4.6 Scenario: Scaffold starter code for a theme with sass Given a WP install - And I run `wp theme path` - And save STDOUT as {THEME_DIR} # Allow for warnings to be generated due to https://github.com/wp-cli/scaffold-command/issues/181 When I try `wp scaffold _s starter-theme --sassify` @@ -432,8 +417,6 @@ Feature: WordPress code scaffolding @require-php-5.6 @require-wp-4.6 Scenario: Scaffold starter code for a WooCommerce theme Given a WP install - And I run `wp theme path` - And save STDOUT as {THEME_DIR} # Allow for warnings to be generated due to https://github.com/wp-cli/scaffold-command/issues/181 When I try `wp scaffold _s starter-theme --woocommerce` @@ -532,8 +515,6 @@ Feature: WordPress code scaffolding Given a WP install When I run `wp core version` Then save STDOUT as {WP_VERSION} - When I run `wp plugin path` - Then save STDOUT as {PLUGIN_DIR} When I run `wp scaffold plugin hello-world` Then STDOUT should not be empty