From f9041cb18870f0a05e608c9d503eecccb5ffbf29 Mon Sep 17 00:00:00 2001 From: Daniel Bachhuber Date: Thu, 16 Nov 2023 15:41:26 +0100 Subject: [PATCH 1/3] Add `@require-mysql` for tests with explicit MySQL dependency --- features/install-wp-tests.feature | 5 +++-- features/scaffold.feature | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/features/install-wp-tests.feature b/features/install-wp-tests.feature index 5338b06a..a955ca58 100644 --- a/features/install-wp-tests.feature +++ b/features/install-wp-tests.feature @@ -264,7 +264,7 @@ Feature: Scaffold install-wp-tests.sh tests Leaving the existing database (wp_cli_test_scaffold) in place """ - @require-php-8.0 @require-wp-5.8 + @require-php-8.0 @require-wp-5.8 @require-mysql Scenario: Install latest version of WordPress on PHP 8.0+ and WordPress above 5.8 Given a WP install And a affirmative-response file: @@ -383,7 +383,7 @@ Feature: Scaffold install-wp-tests.sh tests Leaving the existing database (wp_cli_test_scaffold) in place """ - @require-php-7.0 + @require-php-7.0 @require-mysql Scenario: Install WordPress from trunk Given a WP install And a get-phpunit-phar-url.php file: @@ -485,6 +485,7 @@ Feature: Scaffold install-wp-tests.sh tests 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` Then the return code should be 0 + @require-mysql Scenario: Install WordPress 3.7 and phpunit will not run Given a WP install And I run `wp plugin path` diff --git a/features/scaffold.feature b/features/scaffold.feature index f75b370b..cc25a4b0 100644 --- a/features/scaffold.feature +++ b/features/scaffold.feature @@ -498,7 +498,7 @@ Feature: WordPress code scaffolding Success: Network enabled the 'Starter-theme' theme. """ - @require-php-5.6 @require-wp-4.6 + @require-php-5.6 @require-wp-4.6 @require-mysql Scenario: Scaffold starter code for a theme, but can't unzip theme files Given a WP install And a misconfigured WP_CONTENT_DIR constant directory From 724120eec05f66ccb0c0e05f70dfc085d6fec42c Mon Sep 17 00:00:00 2001 From: Daniel Bachhuber Date: Thu, 16 Nov 2023 15:56:16 +0100 Subject: [PATCH 2/3] Add a couple more `@require-mysql` statements --- features/install-wp-tests.feature | 2 +- features/scaffold.feature | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/features/install-wp-tests.feature b/features/install-wp-tests.feature index a955ca58..8dee816d 100644 --- a/features/install-wp-tests.feature +++ b/features/install-wp-tests.feature @@ -14,7 +14,7 @@ Feature: Scaffold install-wp-tests.sh tests """ And the return code should be 1 - @less-than-php-8.0 @require-php-7.0 + @less-than-php-8.0 @require-php-7.0 @require-mysql Scenario: Install latest version of WordPress Given a WP install And a affirmative-response file: diff --git a/features/scaffold.feature b/features/scaffold.feature index cc25a4b0..23aee121 100644 --- a/features/scaffold.feature +++ b/features/scaffold.feature @@ -379,7 +379,7 @@ Feature: WordPress code scaffolding And the {THEME_DIR}/starter-theme/woocommerce.css file should exist And the {THEME_DIR}/starter-theme/inc/woocommerce.php file should exist - @require-php-5.6 @require-wp-4.6 + @require-php-5.6 @require-wp-4.6 @require-mysql Scenario: Scaffold starter code for a theme and activate it Given a WP install # Allow for warnings to be generated due to https://github.com/wp-cli/scaffold-command/issues/181 From faa8543aedf1d7b1f2ea3e07dff20c6c5e8e15e7 Mon Sep 17 00:00:00 2001 From: Daniel Bachhuber Date: Thu, 16 Nov 2023 16:09:03 +0100 Subject: [PATCH 3/3] Add one more `@require-mysql` statement --- features/scaffold-theme-tests.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/scaffold-theme-tests.feature b/features/scaffold-theme-tests.feature index f03e4bfc..a405a56e 100644 --- a/features/scaffold-theme-tests.feature +++ b/features/scaffold-theme-tests.feature @@ -8,7 +8,7 @@ Feature: Scaffold theme unit tests When I run `wp theme path` Then save STDOUT as {THEME_DIR} - @require-php-7.0 @less-than-php-7.2 + @require-php-7.0 @less-than-php-7.2 @require-mysql Scenario: Scaffold theme tests When I run `wp scaffold theme-tests p2child` Then STDOUT should not be empty