Skip to content

Commit

Permalink
Fix Behat tests
Browse files Browse the repository at this point in the history
  • Loading branch information
swissspidy committed May 16, 2024
1 parent 065dd38 commit f9d89b7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
3 changes: 2 additions & 1 deletion tests/features/info.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
3 changes: 2 additions & 1 deletion tests/features/project.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
4 changes: 3 additions & 1 deletion tests/features/testing.feature
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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:
Expand Down
6 changes: 2 additions & 4 deletions tests/phpunit/tests/Behat/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit f9d89b7

Please sign in to comment.