diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2cdf311..be2a25c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -42,6 +42,7 @@ jobs: # If testing older WordPress versions, ensure they are e.g. 5.7.4, 5.6.6 that have the X3 SSL fix: https://core.trac.wordpress.org/ticket/54207 # For PHP, make sure that an nginx configuration file exists for the required PHP version in this repository at tests/nginx/php-x.x.conf strategy: + fail-fast: false matrix: wp-versions: [ 'latest' ] #[ '6.1.1', 'latest' ] php-versions: [ '7.4', '8.0', '8.1', '8.2' ] #[ '7.4', '8.0', '8.1' ] @@ -82,14 +83,6 @@ jobs: with: path: ${{ env.PLUGIN_DIR }} - # This step is deliberate, to force PHP 7.4 for WP-CLI to work. - # PHP 8.x results in the workflow failing due to incompatibilities between WP-CLI and PHP 8.x. - - name: Install PHP 7.4.26 - uses: shivammathur/setup-php@v2 - with: - php-version: 7.4.26 - coverage: xdebug - # We install WP-CLI, as it provides useful commands to setup and install WordPress through the command line. - name: Install WP-CLI run: | @@ -117,9 +110,9 @@ jobs: run: wp-cli plugin install ${{ secrets.CONVERTKIT_PAID_PLUGIN_URLS }} # WP_DEBUG = true is required so all PHP errors are output and caught by tests (E_ALL). - # WP_DEBUG = false for PHP 8.1, 8.2, otherwise E_DEPRECATED is output due to https://core.trac.wordpress.org/ticket/54504 + # WP_DEBUG = false for PHP 8.2, otherwise E_DEPRECATED is output due to Gravity Forms. - name: Enable WP_DEBUG - if: ${{ matrix.php-versions != '8.1' && matrix.php-versions != '8.2' }} + if: ${{ matrix.php-versions != '8.2' }} working-directory: ${{ env.ROOT_DIR }} run: | wp-cli config set WP_DEBUG true --raw diff --git a/composer.json b/composer.json index cf4d8db..da5d631 100644 --- a/composer.json +++ b/composer.json @@ -15,9 +15,11 @@ "codeception/module-filesystem": "^1.0", "codeception/module-cli": "^1.0", "codeception/util-universalframework": "^1.0", + "php-webdriver/webdriver": "<=1.14.0", "wp-coding-standards/wpcs": "^3.0.0", "phpstan/phpstan": "^1.7", - "szepeviktor/phpstan-wordpress": "^1.0" + "szepeviktor/phpstan-wordpress": "^1.0", + "wp-cli/wp-cli": "2.8.1" }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/tests/_data/dump.sql b/tests/_data/dump.sql index a56e35c..7653419 100644 --- a/tests/_data/dump.sql +++ b/tests/_data/dump.sql @@ -124,7 +124,7 @@ INSERT INTO `wp_options` (`option_id`, `option_name`, `option_value`, `autoload` (43, 'html_type', 'text/html', 'yes'), (44, 'use_trackback', '0', 'yes'), (45, 'default_role', 'subscriber', 'yes'), -(46, 'db_version', '55853', 'yes'), +(46, 'db_version', '56657', 'yes'), (47, 'uploads_use_yearmonth_folders', '1', 'yes'), (48, 'upload_path', '', 'yes'), (49, 'blog_public', '1', 'yes'), @@ -167,9 +167,9 @@ INSERT INTO `wp_options` (`option_id`, `option_name`, `option_value`, `autoload` (86, 'site_icon', '0', 'yes'), (87, 'medium_large_size_w', '768', 'yes'), (88, 'medium_large_size_h', '0', 'yes'), -(89, 'wp_page_for_privacy_policy', '', 'yes'), +(89, 'wp_page_for_privacy_policy', '3', 'yes'), (90, 'show_comments_cookies_opt_in', '1', 'yes'), -(91, 'admin_email_lifespan', '1703943492', 'yes'), +(91, 'admin_email_lifespan', '1712414097', 'yes'), (92, 'disallowed_keys', '', 'no'), (93, 'comment_previously_approved', '1', 'yes'), (94, 'auto_plugin_theme_update_emails', 'a:0:{}', 'no'), @@ -177,13 +177,13 @@ INSERT INTO `wp_options` (`option_id`, `option_name`, `option_value`, `autoload` (96, 'auto_update_core_minor', 'enabled', 'yes'), (97, 'auto_update_core_major', 'enabled', 'yes'), (98, 'wp_force_deactivated_plugins', 'a:0:{}', 'yes'), -(99, 'initial_db_version', '53496', 'yes'), +(99, 'initial_db_version', '55853', 'yes'), (100, 'wp_user_roles', 'a:5:{s:13:\"administrator\";a:2:{s:4:\"name\";s:13:\"Administrator\";s:12:\"capabilities\";a:61:{s:13:\"switch_themes\";b:1;s:11:\"edit_themes\";b:1;s:16:\"activate_plugins\";b:1;s:12:\"edit_plugins\";b:1;s:10:\"edit_users\";b:1;s:10:\"edit_files\";b:1;s:14:\"manage_options\";b:1;s:17:\"moderate_comments\";b:1;s:17:\"manage_categories\";b:1;s:12:\"manage_links\";b:1;s:12:\"upload_files\";b:1;s:6:\"import\";b:1;s:15:\"unfiltered_html\";b:1;s:10:\"edit_posts\";b:1;s:17:\"edit_others_posts\";b:1;s:20:\"edit_published_posts\";b:1;s:13:\"publish_posts\";b:1;s:10:\"edit_pages\";b:1;s:4:\"read\";b:1;s:8:\"level_10\";b:1;s:7:\"level_9\";b:1;s:7:\"level_8\";b:1;s:7:\"level_7\";b:1;s:7:\"level_6\";b:1;s:7:\"level_5\";b:1;s:7:\"level_4\";b:1;s:7:\"level_3\";b:1;s:7:\"level_2\";b:1;s:7:\"level_1\";b:1;s:7:\"level_0\";b:1;s:17:\"edit_others_pages\";b:1;s:20:\"edit_published_pages\";b:1;s:13:\"publish_pages\";b:1;s:12:\"delete_pages\";b:1;s:19:\"delete_others_pages\";b:1;s:22:\"delete_published_pages\";b:1;s:12:\"delete_posts\";b:1;s:19:\"delete_others_posts\";b:1;s:22:\"delete_published_posts\";b:1;s:20:\"delete_private_posts\";b:1;s:18:\"edit_private_posts\";b:1;s:18:\"read_private_posts\";b:1;s:20:\"delete_private_pages\";b:1;s:18:\"edit_private_pages\";b:1;s:18:\"read_private_pages\";b:1;s:12:\"delete_users\";b:1;s:12:\"create_users\";b:1;s:17:\"unfiltered_upload\";b:1;s:14:\"edit_dashboard\";b:1;s:14:\"update_plugins\";b:1;s:14:\"delete_plugins\";b:1;s:15:\"install_plugins\";b:1;s:13:\"update_themes\";b:1;s:14:\"install_themes\";b:1;s:11:\"update_core\";b:1;s:10:\"list_users\";b:1;s:12:\"remove_users\";b:1;s:13:\"promote_users\";b:1;s:18:\"edit_theme_options\";b:1;s:13:\"delete_themes\";b:1;s:6:\"export\";b:1;}}s:6:\"editor\";a:2:{s:4:\"name\";s:6:\"Editor\";s:12:\"capabilities\";a:34:{s:17:\"moderate_comments\";b:1;s:17:\"manage_categories\";b:1;s:12:\"manage_links\";b:1;s:12:\"upload_files\";b:1;s:15:\"unfiltered_html\";b:1;s:10:\"edit_posts\";b:1;s:17:\"edit_others_posts\";b:1;s:20:\"edit_published_posts\";b:1;s:13:\"publish_posts\";b:1;s:10:\"edit_pages\";b:1;s:4:\"read\";b:1;s:7:\"level_7\";b:1;s:7:\"level_6\";b:1;s:7:\"level_5\";b:1;s:7:\"level_4\";b:1;s:7:\"level_3\";b:1;s:7:\"level_2\";b:1;s:7:\"level_1\";b:1;s:7:\"level_0\";b:1;s:17:\"edit_others_pages\";b:1;s:20:\"edit_published_pages\";b:1;s:13:\"publish_pages\";b:1;s:12:\"delete_pages\";b:1;s:19:\"delete_others_pages\";b:1;s:22:\"delete_published_pages\";b:1;s:12:\"delete_posts\";b:1;s:19:\"delete_others_posts\";b:1;s:22:\"delete_published_posts\";b:1;s:20:\"delete_private_posts\";b:1;s:18:\"edit_private_posts\";b:1;s:18:\"read_private_posts\";b:1;s:20:\"delete_private_pages\";b:1;s:18:\"edit_private_pages\";b:1;s:18:\"read_private_pages\";b:1;}}s:6:\"author\";a:2:{s:4:\"name\";s:6:\"Author\";s:12:\"capabilities\";a:10:{s:12:\"upload_files\";b:1;s:10:\"edit_posts\";b:1;s:20:\"edit_published_posts\";b:1;s:13:\"publish_posts\";b:1;s:4:\"read\";b:1;s:7:\"level_2\";b:1;s:7:\"level_1\";b:1;s:7:\"level_0\";b:1;s:12:\"delete_posts\";b:1;s:22:\"delete_published_posts\";b:1;}}s:11:\"contributor\";a:2:{s:4:\"name\";s:11:\"Contributor\";s:12:\"capabilities\";a:5:{s:10:\"edit_posts\";b:1;s:4:\"read\";b:1;s:7:\"level_1\";b:1;s:7:\"level_0\";b:1;s:12:\"delete_posts\";b:1;}}s:10:\"subscriber\";a:2:{s:4:\"name\";s:10:\"Subscriber\";s:12:\"capabilities\";a:2:{s:4:\"read\";b:1;s:7:\"level_0\";b:1;}}}', 'yes'), (101, 'fresh_site', '1', 'yes'), (102, 'user_count', '1', 'no'), (103, 'widget_block', 'a:6:{i:2;a:1:{s:7:\"content\";s:19:\"\";}i:3;a:1:{s:7:\"content\";s:154:\"