strict check for successful request

This commit is contained in:
Saw-jan
2023-10-05 10:52:16 +05:45
committed by Sawjan Gurung
parent 18ac0425cb
commit e439deaba9

View File

@@ -340,19 +340,6 @@ trait Sharing {
$this->ocsContext->theOCSStatusCodeShouldBe("100,200", "", $response);
}
/**
* @When /^the user creates a share using the sharing API with settings$/
*
* @param TableNode|null $body
*
* @return void
* @throws Exception
*/
public function theUserCreatesAShareWithSettings(?TableNode $body):void {
$response = $this->createShareWithSettings($this->currentUser, $body);
$this->setResponse($response);
}
/**
* @When /^user "([^"]*)" creates a public link share using the sharing API with settings$/
*
@@ -400,20 +387,6 @@ trait Sharing {
$this->userCreatesAPublicLinkShareWithSettings($this->currentUser, $body);
}
/**
* @Given /^the user has created a share with settings$/
*
* @param TableNode|null $body
*
* @return void
* @throws Exception
*/
public function theUserHasCreatedAShareWithSettings(?TableNode $body):void {
$response = $this->createShareWithSettings($this->currentUser, $body);
$this->theHTTPStatusCodeShouldBe(200, "", $response);
$this->ocsContext->theOCSStatusCodeShouldBe("100,200", "", $response);
}
/**
* @Given /^the user has created a public link share with settings$/
*
@@ -875,7 +848,9 @@ trait Sharing {
);
// save the created share data
if ($response->getStatusCode() === 200) {
if (($response->getStatusCode() === 200)
&& \in_array($this->ocsContext->getOCSResponseStatusCode($response), ['100', '200'])
) {
$xmlResponse = $this->getResponseXml($response);
if (isset($xmlResponse->data)) {
$shareData = $xmlResponse->data;