woocommerce / qit-cli

A Testing Platform for WordPress Plugins and Themes
https://qit.woo.com
15 stars 2 forks source link

Use Input instead of argv, activate Woo instead of bootstrapping when using "--woo" parameter #178

Closed Luc45 closed 2 months ago

Luc45 commented 2 months ago

This PR is a continuation of this PR, with an additional fix that I forgot to include in that PR.

Previously, when the RunE2ECommand triggered the creation of a test environment via UpEnvironmentCommand, the latter would read command-line parameters directly from $argv, which contains user-defined input. The issue arose because UpEnvironmentCommand was inadvertently using the $argv parameters intended for RunE2ECommand, since both commands were executed within the same process.

To resolve this, this PR modifies UpEnvironmentCommand to accept options through a dedicated variable. If this variable is set, UpEnvironmentCommand will use these values; otherwise, it will fall back to $argv. This ensures correct parameter usage, particularly when environments are set up independently of the RunE2ECommand.

Testing Instructions

Screenshots

Test passing as instructed

image

Self-tests passing

1 snapshot regenerated, which is the one in this PR.

image