test: add settings helper

test: move methods to helper
This commit is contained in:
Saw-jan
2024-07-03 12:16:06 +05:45
parent 18d0eaa5c2
commit a8ee23734c
7 changed files with 353 additions and 136 deletions
+11
View File
@@ -685,4 +685,15 @@ class HttpRequestHelper {
$timeout = \getenv("REQUEST_TIMEOUT");
return (int)$timeout ?: 60;
}
/**
* returns json decoded body content of a json response as an object
*
* @param ResponseInterface $response
*
* @return mixed
*/
public static function getJsonDecodedResponseBodyContent(ResponseInterface $response): mixed {
return json_decode($response->getBody()->getContents(), null, 512, JSON_THROW_ON_ERROR);
}
}