Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions tests/acceptance/bootstrap/WebDav.php
Original file line number Diff line number Diff line change
Expand Up @@ -1264,20 +1264,18 @@ public function checkFileOrFolderDoesNotExistsForUser(
$type
);
$statusCode = $response->getStatusCode();
if ($statusCode < 400 || $statusCode > 499) {
try {
$responseXmlObject = HttpRequestHelper::getResponseXml(
$response,
__METHOD__
);
} catch (Exception $e) {
Assert::fail(
"$entry '$path' should not exist. But API returned $statusCode without XML in the body"
);
}
// when checking path with '..' it may return 405 Method Not Allowed
if ($statusCode === 404 || $statusCode === 405) {
return;
}
if ($statusCode === 207) {
$responseXmlObject = HttpRequestHelper::getResponseXml(
$response,
__METHOD__
);
Assert::assertTrue(
$this->isEtagValid($this->getEtagFromResponseXmlObject($responseXmlObject)),
"$entry '$path' should not exist. But API returned $statusCode without an etag in the body"
"$entry '$path' should not exist but found with invalid etag."
);
$isCollection = $responseXmlObject->xpath("//d:prop/d:resourcetype/d:collection");
if (\count($isCollection) === 0) {
Expand All @@ -1291,7 +1289,11 @@ public function checkFileOrFolderDoesNotExistsForUser(
"$entry '$path' should not exist. But it does."
);
}
return;
}
Assert::fail(
"$entry '$path' should not exist. But API returned $statusCode without XML in the body"
);
}

/**
Expand Down