sabre-io / http

The sabre/http library provides utilities for dealing with http requests and responses.
http://sabre.io/http/
BSD 3-Clause "New" or "Revised" License
187 stars 62 forks source link

[5.1] Enhance tests/bootstrap.php to find autoloader in more environments #225

Closed phil-davis closed 1 year ago

phil-davis commented 1 year ago

Fixes https://github.com/sabre-io/dav/issues/1484

When the sabre/http unit tests are run from inside the sabre/dav repo, the https://github.com/sabre-io/http/blob/master/tests/www/connection_aborted.php code includes https://github.com/sabre-io/http/blob/master/tests/bootstrap.php

https://github.com/sabre-io/http/blob/master/tests/bootstrap.php tries to find an autoloader.php to run, but in that environment, autoloader.php is actually found a few levels up - see the comments in the code for details.

This enhancement to https://github.com/sabre-io/http/blob/master/tests/bootstrap.php lets connection_aborted.php find HTTP\Response() and so it runs properly.

The test that makes use of it now passes even when run from inside the sabre/dav repo - I have tried manually on my laptop.

This is all a bit of a pain, but anyway, we may as well patch it up for now.

phil-davis commented 1 year ago

When this is sorted out and merged, I will need to release sabre/http 5.1.10 so that this test code change ends up in the release package.