diff --git a/features/plugin-install.feature b/features/plugin-install.feature index 3f7a724d..8943e738 100644 --- a/features/plugin-install.feature +++ b/features/plugin-install.feature @@ -168,7 +168,7 @@ Feature: Install WordPress plugins Scenario: Paths aren't backslashed when destination folder already exists Given a WP install - When I run `pwd` + When I run `wp eval "echo str_replace(chr(92), '/', getcwd());"` Then save STDOUT as {WORKING_DIR} When I run `rm wp-content/plugins/akismet/akismet.php` diff --git a/features/plugin-list-recently-active.feature b/features/plugin-list-recently-active.feature index a3eb97f9..cbd97bf5 100644 --- a/features/plugin-list-recently-active.feature +++ b/features/plugin-list-recently-active.feature @@ -42,6 +42,8 @@ Feature: List recently active WordPress plugins | debug-bar | | site-secrets | + # Skipped on Windows due to non-portable shell command substitution and newline discrepancies + @skip-windows Scenario: Use recently active plugin to activate plugins Given a WP install @@ -114,6 +116,8 @@ Feature: List recently active WordPress plugins | debug-bar | | site-secrets | + # Skipped on Windows due to non-portable shell command substitution and newline discrepancies + @skip-windows Scenario: For a MU site, use recently active plugin to activate plugins Given a WP multisite install diff --git a/features/plugin-update.feature b/features/plugin-update.feature index 73577748..771454d6 100644 --- a/features/plugin-update.feature +++ b/features/plugin-update.feature @@ -198,7 +198,8 @@ Feature: Update WordPress plugins """ # Akismet currently requires WordPress 5.8 - @require-wp-5.8 + # Skipped on Windows because chmod does not reliably enforce unwritable files cross-platform + @require-wp-5.8 @skip-windows Scenario: Plugin updates that error should not report a success Given a WP install And I run `wp plugin install --force akismet --version=4.0` @@ -237,7 +238,8 @@ Feature: Update WordPress plugins """ And the return code should be 0 - @require-wp-5.2 + # Skipped on Windows because of sed usage that would need to be refactored for compatibility. + @require-wp-5.2 @skip-windows Scenario: Updating all plugins with some of them having an invalid version shouldn't report an error Given a WP install And I run `wp plugin delete akismet` @@ -378,7 +380,8 @@ Feature: Update WordPress plugins Success: Updated 2 of 2 plugins. """ - @require-wp-5.2 + # Skipped on Windows because of mkdir usage that would need to be refactored for compatibility. + @require-wp-5.2 @skip-windows Scenario: Skip plugin update when plugin directory is a VCS checkout Given a WP install And I run `wp plugin install wordpress-importer --version=0.5 --force` @@ -397,7 +400,8 @@ Feature: Update WordPress plugins """ And the return code should be 1 - @require-wp-5.2 + # Skipped on Windows because of mkdir usage that would need to be refactored for compatibility. + @require-wp-5.2 @skip-windows Scenario: Update plugin in VCS checkout when --include-vcs is set Given a WP install And I run `wp plugin install wordpress-importer --version=0.5 --force` diff --git a/features/plugin.feature b/features/plugin.feature index 55839362..69445491 100644 --- a/features/plugin.feature +++ b/features/plugin.feature @@ -356,13 +356,13 @@ Feature: Manage WordPress plugins Automattic """ - When I run `wp eval 'echo get_site_transient("update_plugins")->last_checked;'` + When I run `wp eval "echo get_site_transient('update_plugins')->last_checked;"` Then save STDOUT as {LAST_UPDATED} When I run `wp plugin list --skip-update-check` Then STDOUT should not be empty - When I run `wp eval 'echo get_site_transient("update_plugins")->last_checked;'` + When I run `wp eval "echo get_site_transient('update_plugins')->last_checked;"` Then STDOUT should be: """ {LAST_UPDATED} @@ -371,7 +371,7 @@ Feature: Manage WordPress plugins When I run `wp plugin list` Then STDOUT should not be empty - When I run `wp eval 'echo get_site_transient("update_plugins")->last_checked;'` + When I run `wp eval "echo get_site_transient('update_plugins')->last_checked;"` Then STDOUT should not contain: """ {LAST_UPDATED} @@ -467,7 +467,7 @@ Feature: Manage WordPress plugins Given a WP install When I run `rm -rf wp-content/plugins` - And I run `if test -d wp-content/plugins; then echo "fail"; fi` + And I run `wp eval "if ( is_dir('wp-content/plugins') ) echo 'fail';"` Then STDOUT should be empty When I run `wp plugin install wordpress-importer --activate` diff --git a/features/theme-update.feature b/features/theme-update.feature index 09633781..de2eeefd 100644 --- a/features/theme-update.feature +++ b/features/theme-update.feature @@ -264,7 +264,7 @@ Feature: Update WordPress themes And I run `wp theme path twentytwelve --dir` And save STDOUT as {THEME_DIR} - When I run `mkdir {THEME_DIR}/.git` + When I run `wp eval "is_dir( '{THEME_DIR}/.git' ) || mkdir( '{THEME_DIR}/.git', 0777, true ) || exit( 1 );"` And I try `wp theme update twentytwelve` Then STDERR should contain: """ @@ -282,7 +282,7 @@ Feature: Update WordPress themes And I run `wp theme path twentytwelve --dir` And save STDOUT as {THEME_DIR} - When I run `mkdir {THEME_DIR}/.git` + When I run `wp eval "is_dir( '{THEME_DIR}/.git' ) || mkdir( '{THEME_DIR}/.git', 0777, true ) || exit( 1 );"` And I run `wp theme update twentytwelve --include-vcs` Then STDOUT should contain: """ diff --git a/features/theme.feature b/features/theme.feature index 53ea0303..ff9c1cc1 100644 --- a/features/theme.feature +++ b/features/theme.feature @@ -243,13 +243,13 @@ Feature: Manage WordPress themes When I run `wp theme list` Then STDOUT should not be empty - When I run `wp eval 'echo get_site_transient("update_themes")->last_checked;'` + When I run `wp eval "echo get_site_transient( 'update_themes' )->last_checked;"` Then save STDOUT as {LAST_UPDATED} When I run `wp theme list --skip-update-check` Then STDOUT should not be empty - When I run `wp eval 'echo get_site_transient("update_themes")->last_checked;'` + When I run `wp eval "echo get_site_transient( 'update_themes' )->last_checked;"` Then STDOUT should be: """ {LAST_UPDATED} @@ -258,7 +258,7 @@ Feature: Manage WordPress themes When I run `wp theme list` Then STDOUT should not be empty - When I run `wp eval 'echo get_site_transient("update_themes")->last_checked;'` + When I run `wp eval "echo get_site_transient( 'update_themes' )->last_checked;"` Then STDOUT should not contain: """ {LAST_UPDATED} @@ -269,7 +269,7 @@ Feature: Manage WordPress themes And I run `wp theme delete --all --force` When I run `rm -rf wp-content/themes` - And I run `if test -d wp-content/themes; then echo "fail"; fi` + And I run `wp eval "if ( is_dir('wp-content/themes') ) echo 'fail';"` Then STDOUT should be empty When I run `wp theme install twentytwelve --activate` @@ -283,7 +283,7 @@ Feature: Manage WordPress themes Scenario: Attempt to activate or fetch a broken theme Given a WP install - When I run `mkdir -pv wp-content/themes/myth` + When I run `wp eval "is_dir( 'wp-content/themes/myth' ) || mkdir( 'wp-content/themes/myth', 0777, true ) || exit( 1 );"` Then the wp-content/themes/myth directory should exist When I try `wp theme activate myth`