From f9d89b765dba16b60c70aaf10d4fddcd6b83a9dc Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Thu, 16 May 2024 14:43:15 +0200 Subject: [PATCH] Fix Behat tests --- tests/features/info.feature | 3 ++- tests/features/project.feature | 3 ++- tests/features/testing.feature | 4 +++- tests/phpunit/tests/Behat/FeatureContext.php | 6 ++---- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/tests/features/info.feature b/tests/features/info.feature index 4f4b342..ff3ca96 100644 --- a/tests/features/info.feature +++ b/tests/features/info.feature @@ -2,8 +2,9 @@ Feature: Print various details about the environment. Background: - Given a WP installation with the Traduttore plugin + Given a WP installation And GlotPress develop being active + And Traduttore being active Scenario: Run info command When I run the WP-CLI command `traduttore info` diff --git a/tests/features/project.feature b/tests/features/project.feature index e7e6d77..f945091 100644 --- a/tests/features/project.feature +++ b/tests/features/project.feature @@ -2,8 +2,9 @@ Feature: Print various details about the environment. Background: - Given a WP installation with the Traduttore plugin + Given a WP installation And GlotPress develop being active + And Traduttore being active Scenario: Run info command with invalid project ID When I try the WP-CLI command `traduttore project info 99999` diff --git a/tests/features/testing.feature b/tests/features/testing.feature index 7eebf37..28922bc 100644 --- a/tests/features/testing.feature +++ b/tests/features/testing.feature @@ -1,11 +1,12 @@ Feature: Test that the tests are working. Background: - Given a WP installation with the Traduttore plugin + Given a WP installation @require-php-7.4 Scenario: Traduttore and GlotPress develop should be active. Given GlotPress develop being active + And Traduttore being active When I run `wp plugin status glotpress` Then STDOUT should contain: @@ -31,6 +32,7 @@ Feature: Test that the tests are working. Scenario: Traduttore and GlotPress stable should be active. Given GlotPress stable being active + And Traduttore being active When I run `wp plugin status glotpress` Then STDOUT should contain: diff --git a/tests/phpunit/tests/Behat/FeatureContext.php b/tests/phpunit/tests/Behat/FeatureContext.php index 821302d..5fd10f1 100644 --- a/tests/phpunit/tests/Behat/FeatureContext.php +++ b/tests/phpunit/tests/Behat/FeatureContext.php @@ -67,11 +67,9 @@ public static function forget_feature( AfterFeatureScope $scope ): void { } /** - * @Given a WP install(ation) with the Traduttore plugin + * @Given Traduttore being active */ - public function given_a_wp_installation_with_the_traduttore_plugin(): void { - $this->install_wp(); - + public function given_traduttore_being_active(): void { // Symlink the current project folder into the WP folder as a plugin. $project_dir = realpath( self::get_vendor_dir() . '/../' ); $plugin_dir = $this->variables['RUN_DIR'] . '/wp-content/plugins';