Skip to content

Commit

Permalink
Handle createShare 4xx status cleanly
Browse files Browse the repository at this point in the history
  • Loading branch information
phil-davis committed May 31, 2022
1 parent 54e1fb8 commit f09f57c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/acceptance/features/bootstrap/Sharing.php
Original file line number Diff line number Diff line change
Expand Up @@ -1134,8 +1134,10 @@ public function createShare(
$this->sharingApiVersion,
$sharingApp
);
// In case of HTTP status code 204, there is no content in response payload body.
if ($this->response->getStatusCode() === 204) {
// In case of HTTP status code 204 "no content", or a failure code like 4xx
// there is no content in response payload body. Clear the test-runner's memory
// of "last share data" to avoid later steps accidentally using some previous share data.
if (($this->response->getStatusCode() === 204) || !$this->theHTTPStatusCodeWasSuccess()) {
if ($shareType === 'public_link') {
$this->lastPublicShareData = null;
$this->lastPublicShareId = null;
Expand Down

0 comments on commit f09f57c

Please sign in to comment.