Skip to content

Commit

Permalink
Enhance tests/bootstrap.php to find autoloader in more environments
Browse files Browse the repository at this point in the history
  • Loading branch information
phil-davis committed Aug 17, 2023
1 parent 3736ece commit 236e940
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 236e940

Please sign in to comment.