test: make remote.php configurable

test: build dav paths

test: fix paths

test: merge method args

test: add issue tags

test: add new expected failure file

test: merge expected-failure files before running tests
This commit is contained in:
Saw-jan
2024-09-17 17:11:20 +05:45
parent 273915506e
commit f86d137f87
100 changed files with 2484 additions and 2329 deletions
@@ -104,6 +104,27 @@ class HttpRequestHelper {
$timeout
);
}
if (WebdavHelper::isDAVRequest($url) && \str_starts_with($url, OcisHelper::getServerUrl())) {
$withRemotePhp = \getenv("WITH_REMOTE_PHP") === "true";
$urlHasRemotePhp = \str_contains($url, 'remote.php');
if (!$withRemotePhp && $urlHasRemotePhp) {
throw new Exception("remote.php is disabled but found in the URL: $url");
}
if ($withRemotePhp && !$urlHasRemotePhp) {
throw new Exception("remote.php is enabled but not found in the URL: $url");
}
if ($headers && \array_key_exists("Destination", $headers)) {
if (!$withRemotePhp && $urlHasRemotePhp) {
throw new Exception("remote.php is disabled but found in the URL: $url");
}
if ($withRemotePhp && !$urlHasRemotePhp) {
throw new Exception("remote.php is enabled but not found in the URL: $url");
}
}
}
$request = self::createRequest(
$url,
$xRequestId,