From 5f2a24ddc9aa3c4795047039055c05e5c01d254f Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Sat, 28 Mar 2026 12:36:30 +0100 Subject: [PATCH 1/3] Use curl instead of wget in tests --- features/install-wp-tests.feature | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/features/install-wp-tests.feature b/features/install-wp-tests.feature index 3324ac19..93e45b89 100644 --- a/features/install-wp-tests.feature +++ b/features/install-wp-tests.feature @@ -45,7 +45,7 @@ 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 `wget -q -O phpunit {PHPUNIT_PHAR_URL}` + And I run `curl -sS -L -o phpunit {PHPUNIT_PHAR_URL}` And I run `chmod +x phpunit` And I run `wp plugin path` And save STDOUT as {PLUGIN_DIR} @@ -164,7 +164,7 @@ 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 `wget -q -O phpunit {PHPUNIT_PHAR_URL}` + And I run `curl -sS -L -o phpunit {PHPUNIT_PHAR_URL}` And I run `chmod +x phpunit` And I run `wp plugin path` And save STDOUT as {PLUGIN_DIR} @@ -295,7 +295,7 @@ 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 `wget -q -O phpunit {PHPUNIT_PHAR_URL}` + And I run `curl -sS -L -o phpunit {PHPUNIT_PHAR_URL}` And I run `chmod +x phpunit` And I run `wp plugin path` And save STDOUT as {PLUGIN_DIR} @@ -406,7 +406,7 @@ 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 `wget -q -O phpunit {PHPUNIT_PHAR_URL}` + And I run `curl -sS -L -o phpunit {PHPUNIT_PHAR_URL}` And I run `chmod +x phpunit` And I run `wp plugin path` And save STDOUT as {PLUGIN_DIR} From da70d0ba38ca3c40403c8c1a028f3e7599f16b44 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Sat, 28 Mar 2026 16:11:13 +0100 Subject: [PATCH 2/3] Avoid using chmod --- features/install-wp-tests.feature | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/features/install-wp-tests.feature b/features/install-wp-tests.feature index 93e45b89..cf590746 100644 --- a/features/install-wp-tests.feature +++ b/features/install-wp-tests.feature @@ -46,7 +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 -o phpunit {PHPUNIT_PHAR_URL}` - And I run `chmod +x phpunit` And I run `wp plugin path` And save STDOUT as {PLUGIN_DIR} And I run `wp scaffold plugin hello-world` @@ -108,7 +107,7 @@ Feature: Scaffold install-wp-tests.sh tests When I run `composer install --no-interaction --working-dir=polyfills --quiet` Then the return code should be 0 - When I run `WP_TESTS_DIR={RUN_DIR}/wordpress-tests-lib WP_TESTS_PHPUNIT_POLYFILLS_PATH={RUN_DIR}/polyfills/vendor/yoast/phpunit-polyfills ./phpunit -c {PLUGIN_DIR}/hello-world/phpunit.xml.dist` + When I run `WP_TESTS_DIR={RUN_DIR}/wordpress-tests-lib WP_TESTS_PHPUNIT_POLYFILLS_PATH={RUN_DIR}/polyfills/vendor/yoast/phpunit-polyfills php phpunit -c {PLUGIN_DIR}/hello-world/phpunit.xml.dist` Then the return code should be 0 When I try `WP_TESTS_DIR={RUN_DIR}/wordpress-tests-lib WP_CORE_DIR={RUN_DIR}/wordpress /usr/bin/env bash {PLUGIN_DIR}/hello-world/bin/install-wp-tests.sh wp_cli_test_scaffold {DB_USER} {DB_PASSWORD} {DB_HOST} latest < affirmative-response` @@ -165,7 +164,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 -o phpunit {PHPUNIT_PHAR_URL}` - And I run `chmod +x phpunit` And I run `wp plugin path` And save STDOUT as {PLUGIN_DIR} And I run `wp scaffold plugin hello-world` @@ -227,7 +225,7 @@ Feature: Scaffold install-wp-tests.sh tests When I run `composer install --no-interaction --working-dir=polyfills --quiet` Then the return code should be 0 - When I try `WP_TESTS_DIR={RUN_DIR}/wordpress-tests-lib WP_TESTS_PHPUNIT_POLYFILLS_PATH={RUN_DIR}/polyfills/vendor/yoast/phpunit-polyfills ./phpunit -c {PLUGIN_DIR}/hello-world/phpunit.xml.dist` + When I try `WP_TESTS_DIR={RUN_DIR}/wordpress-tests-lib WP_TESTS_PHPUNIT_POLYFILLS_PATH={RUN_DIR}/polyfills/vendor/yoast/phpunit-polyfills php phpunit -c {PLUGIN_DIR}/hello-world/phpunit.xml.dist` Then the return code should be 1 And STDOUT should contain: """ @@ -296,7 +294,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 -o phpunit {PHPUNIT_PHAR_URL}` - And I run `chmod +x phpunit` And I run `wp plugin path` And save STDOUT as {PLUGIN_DIR} And I run `wp scaffold plugin hello-world` @@ -358,7 +355,7 @@ Feature: Scaffold install-wp-tests.sh tests When I run `composer install --no-interaction --working-dir=polyfills --quiet` Then the return code should be 0 - When I run `WP_TESTS_DIR={RUN_DIR}/wordpress-tests-lib WP_TESTS_PHPUNIT_POLYFILLS_PATH={RUN_DIR}/polyfills/vendor/yoast/phpunit-polyfills ./phpunit -c {PLUGIN_DIR}/hello-world/phpunit.xml.dist` + When I run `WP_TESTS_DIR={RUN_DIR}/wordpress-tests-lib WP_TESTS_PHPUNIT_POLYFILLS_PATH={RUN_DIR}/polyfills/vendor/yoast/phpunit-polyfills php phpunit -c {PLUGIN_DIR}/hello-world/phpunit.xml.dist` Then the return code should be 0 When I try `WP_TESTS_DIR={RUN_DIR}/wordpress-tests-lib WP_CORE_DIR={RUN_DIR}/wordpress /usr/bin/env bash {PLUGIN_DIR}/hello-world/bin/install-wp-tests.sh wp_cli_test_scaffold {DB_USER} {DB_PASSWORD} {DB_HOST} latest < affirmative-response` @@ -407,7 +404,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 -o phpunit {PHPUNIT_PHAR_URL}` - And I run `chmod +x phpunit` And I run `wp plugin path` And save STDOUT as {PLUGIN_DIR} And I run `wp scaffold plugin hello-world` @@ -482,7 +478,7 @@ Feature: Scaffold install-wp-tests.sh tests When I run `composer install --no-interaction --quiet --working-dir={RUN_DIR}/wordpress-tests-lib` Then the return code should be 0 - When I run `WP_TESTS_DIR={RUN_DIR}/wordpress-tests-lib WP_TESTS_PHPUNIT_POLYFILLS_PATH={RUN_DIR}/wordpress-tests-lib/vendor/yoast/phpunit-polyfills ./phpunit -c {PLUGIN_DIR}/hello-world/phpunit.xml.dist` + When I run `WP_TESTS_DIR={RUN_DIR}/wordpress-tests-lib WP_TESTS_PHPUNIT_POLYFILLS_PATH={RUN_DIR}/wordpress-tests-lib/vendor/yoast/phpunit-polyfills php phpunit -c {PLUGIN_DIR}/hello-world/phpunit.xml.dist` Then the return code should be 0 @require-mysql From 3a06099eddaf12048690f6a99eb6d022bed2b227 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Sat, 28 Mar 2026 16:19:12 +0100 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- features/install-wp-tests.feature | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/features/install-wp-tests.feature b/features/install-wp-tests.feature index cf590746..16999ad0 100644 --- a/features/install-wp-tests.feature +++ b/features/install-wp-tests.feature @@ -45,7 +45,7 @@ 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 -o phpunit {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` @@ -163,7 +163,7 @@ 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 -o phpunit {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` @@ -293,7 +293,7 @@ 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 -o phpunit {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` @@ -403,7 +403,7 @@ 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 -o phpunit {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`