Skip to content

fix: support running Pest when symlinked#1611

Closed
sunchayn wants to merge 1 commit intopestphp:4.xfrom
sunchayn:bug/support-running-pest-when-symlinked
Closed

fix: support running Pest when symlinked#1611
sunchayn wants to merge 1 commit intopestphp:4.xfrom
sunchayn:bug/support-running-pest-when-symlinked

Conversation

@sunchayn
Copy link
Copy Markdown

What:

  • Bug Fix
  • New Feature

Description:

When Pest is installed as a symlinked dependency (e.g., using a Composer path repository), PHP's __DIR__ constant resolves to the physical path of the Pest package (e.g., /Volumes/Dev/pest/bin).

This leads to two problems:

  1. Pest loads the wrong autoload file, /Volumes/Dev/pest/vendor/autoload.php instead of /Volumes/Dev/{dependantRepo}/vendor/autoload.php.
  2. The repo's tests/Pest.php file will not be called. Since the wrong autoloader will load the wrong TestSuite instance, the rootpath will be Pest's rootpath instead of the repo's rootpath.

@sunchayn sunchayn closed this Jan 31, 2026
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.

1 participant