test: add settings helper

test: move methods to helper
This commit is contained in:
Saw-jan
2024-07-08 09:44:48 +05:45
parent 18d0eaa5c2
commit a8ee23734c
7 changed files with 353 additions and 136 deletions
@@ -553,7 +553,12 @@ class OCSContext implements Context {
* @throws Exception
*/
public function getOCSResponseStatusCode(ResponseInterface $response):string {
$jsonResponse = $this->featureContext->getJsonDecodedResponseBodyContent($response);
try {
$jsonResponse = $this->featureContext->getJsonDecodedResponseBodyContent($response);
} catch (JsonException $e) {
$jsonResponse = null;
}
if (\is_object($jsonResponse) && $jsonResponse->ocs->meta->statuscode) {
return (string) $jsonResponse->ocs->meta->statuscode;
}