Skip to content

Commit

Permalink
Merge pull request #225 from phil-davis/enhance-tests-bootstrap-autoload
Browse files Browse the repository at this point in the history
[5.1] Enhance tests/bootstrap.php to find autoloader in more environments
  • Loading branch information
phil-davis authored Aug 18, 2023
2 parents 3736ece + 236e940 commit eee8bb8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,11 @@
ini_set('error_reporting', (string) (E_ALL | E_STRICT | E_DEPRECATED));

// Composer autoloader
include __DIR__.'/../vendor/autoload.php';
if (file_exists(__DIR__.'/../vendor/autoload.php')) {
include __DIR__.'/../vendor/autoload.php';
} else {
// We may be running as a dependency inside some other repo.
// So we are probably in vendor/sabre/http/tests of that repo.
// Go up 3 levels to find autoload.php
include __DIR__.'/../../../autoload.php';
}

0 comments on commit eee8bb8

Please sign in to comment.