Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Look into getcwd() first when searching for vendor folder #180

Merged
merged 1 commit into from
Oct 3, 2023

Conversation

schlessera
Copy link
Member

@schlessera schlessera commented Oct 3, 2023

When the Behat context setup tried to find the vendor folder, it did not look into the current working folder first, instead always finding the vendor folder within the tests dependency instead.

This PR adapts the logic so that the current working directory gets searched first.

As an example, when running composer behat from within the wp-cli-dev/config-command folder, this is the resulting change:

BEFORE

Vendor folder location: /home/alain/dev/wp-cli-dev/wp-cli-tests/vendor
Framework folder location: /home/alain/dev/wp-cli-dev/wp-cli-tests/vendor/wp-cli/wp-cli
WP-CLI binary path: /home/alain/dev/wp-cli-dev/wp-cli-tests/vendor/bin

AFTER

Vendor folder location: /home/alain/dev/wp-cli-dev/config-command/vendor
Framework folder location: /home/alain/dev/wp-cli-dev/config-command/vendor/wp-cli/wp-cli
WP-CLI binary path: /home/alain/dev/wp-cli-dev/config-command/vendor/bin
Project config file location: /tmp/wp-cli-package-test/config.yml
Project config:
require:
  - /home/alain/dev/wp-cli-dev/config-command/config-command.php

The main issue this has caused is that local configuration files used in packages to make sure the current source files are being loaded over any existing package had been ignored.

@schlessera schlessera requested a review from a team as a code owner October 3, 2023 10:11
@schlessera schlessera changed the title Look into getcwd() first when searching for vendor folder Look into getcwd() first when searching for vendor folder Oct 3, 2023
@schlessera schlessera added bug Something isn't working scope:testing labels Oct 3, 2023
@schlessera schlessera added this to the 4.0.3 milestone Oct 3, 2023
@schlessera schlessera merged commit c2d228b into main Oct 3, 2023
32 checks passed
@schlessera schlessera deleted the fix/look-into-working-dir-first branch October 3, 2023 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working scope:testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants