Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 6, 2025

  • Explore repository structure and understand codebase
  • Add new Behat step for "Given a WP installation with version X"
  • Add new Behat step for "Given a WP installation in 'subdir' with version X"
  • Update install_wp and download_wp methods to accept version parameter
  • Fix cache directory validation to handle version-specific downloads
  • Add tests for the new functionality
  • Simplify version suffix logic based on code review feedback
  • Change to natural syntax: "Given a WP X.X.X install(ation)"
  • Combine step definitions using regex patterns
  • Simplify regex to use single capture group with trim()

Summary

Simplified the regex patterns by using a single capture group instead of nested groups:

Before:

@Given /^a WP( ([^\s]+))? install(?:ation)?$/
public function given_a_wp_installation( $version_with_space = '', $version = '' ): void {
    $this->install_wp( '', $version );
}

After:

@Given /^a WP( [^\s]+)? install(?:ation)?$/
public function given_a_wp_installation( $version = '' ): void {
    $this->install_wp( '', trim( $version ) );
}

The version parameter now includes the leading space when present, which is trimmed before use.

Original prompt

This section details on the original issue you should resolve

<issue_title>Add a step for "Given a WP installation" for a specific version</issue_title>
<issue_description>To prevent the two step process of:

Given a WP install
And I run `wp core download --force --version=<version>`

It would be helpful to have a one step equivalent.</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Add step for given a WP installation Add Behat step for installing WordPress with specific version Nov 6, 2025
Copilot AI requested a review from swissspidy November 6, 2025 09:59
@codecov
Copy link

codecov bot commented Nov 6, 2025

Codecov Report

❌ Patch coverage is 0% with 17 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/Context/FeatureContext.php 0.00% 13 Missing ⚠️
src/Context/GivenStepDefinitions.php 0.00% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

@swissspidy

This comment was marked as resolved.

This comment was marked as resolved.

@swissspidy

This comment was marked as resolved.

This comment was marked as resolved.

@swissspidy swissspidy marked this pull request as ready for review November 6, 2025 20:47
@swissspidy swissspidy requested a review from a team as a code owner November 6, 2025 20:47
@swissspidy swissspidy added this to the 5.0.4 milestone Dec 1, 2025
@schlessera schlessera merged commit 77d4758 into main Dec 9, 2025
49 of 51 checks passed
@schlessera schlessera deleted the copilot/add-given-wp-install-step branch December 9, 2025 14:38
swissspidy added a commit that referenced this pull request Dec 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a step for "Given a WP installation" for a specific version

3 participants