test: allow items check for multiple array items

This commit is contained in:
Saw-jan
2024-12-11 11:55:47 +05:45
committed by Niraj Acharya
parent 6c00b5d26b
commit 7546e476be
5 changed files with 44 additions and 68 deletions
@@ -28,11 +28,10 @@ use Psr\Http\Message\ResponseInterface;
* A helper class for managing Auth App API requests
*/
class AuthAppHelper {
/**
* @return string
*/
public static function getAuthAppEndpoint():string {
public static function getAuthAppEndpoint(): string {
return "/auth-app/tokens";
}
@@ -43,7 +42,7 @@ class AuthAppHelper {
*
* @return ResponseInterface
*/
public static function listAllAppAuthToken(string $baseUrl, string $user, string $password) : ResponseInterface {
public static function listAllAppAuthTokensForUser(string $baseUrl, string $user, string $password): ResponseInterface {
$url = $baseUrl . self::getAuthAppEndpoint();
return HttpRequestHelper::sendRequest(
$url,
@@ -62,7 +61,7 @@ class AuthAppHelper {
*
* @return ResponseInterface
*/
public static function createAppAuthToken(string $baseUrl, string $user, string $password, string $expiration) : ResponseInterface {
public static function createAppAuthToken(string $baseUrl, string $user, string $password, string $expiration): ResponseInterface {
$url = $baseUrl . self::getAuthAppEndpoint() . "?expiry=$expiration";
return HttpRequestHelper::sendRequest(
$url,
@@ -81,7 +80,7 @@ class AuthAppHelper {
*
* @return ResponseInterface
*/
public static function deleteAppAuthToken(string $baseUrl, string $user, string $password, string $token) : ResponseInterface {
public static function deleteAppAuthToken(string $baseUrl, string $user, string $password, string $token): ResponseInterface {
$url = $baseUrl . self::getAuthAppEndpoint() . "?token=$token";
return HttpRequestHelper::sendRequest(
$url,