Merge pull request #10234 from owncloud/tests-limit-with-sort-activities

[tests-only][full-ci] add test to check api activities with limit and sort filter
This commit is contained in:
Sawjan Gurung
2024-10-08 16:33:44 +05:45
committed by GitHub
2 changed files with 54 additions and 2 deletions

View File

@@ -2805,7 +2805,7 @@ class GraphContext implements Context {
}
/**
* @When /^user "([^"]*)" lists the activities of (?:folder|file) "([^"]*)" from space "([^"]*)" using the Graph API/
* @When /^user "([^"]*)" lists the activities of (?:folder|file) "([^"]*)" from space "([^"]*)" using the Graph API$/
*
* @param string $user
* @param string $resource
@@ -2936,7 +2936,7 @@ class GraphContext implements Context {
}
/**
* @When /^user "([^"]*)" lists the activities of (?:folder|file) "([^"]*)" from space "([^"]*)" with (depth|limit|sort) "([^"]*)" using the Graph API/
* @When /^user "([^"]*)" lists the activities of (?:folder|file) "([^"]*)" from space "([^"]*)" with (depth|limit|sort) "([^"]*)" using the Graph API$/
*
* @param string $user
* @param string $resource
@@ -2979,6 +2979,39 @@ class GraphContext implements Context {
}
}
/**
* @When /^user "([^"]*)" lists the activities of (?:folder|file) "([^"]*)" from space "([^"]*)" with (depth|limit) "([^"]*)" and sort "(asc|desc)" using the Graph API$/
*
* @param string $user
* @param string $resource
* @param string $spaceName
* @param string $filterType
* @param string $filterValue
* @param string $sortType
*
* @return void
* @throws GuzzleException
*/
public function userListsTheActivitiesOfResourceFromSpaceWithDepthOrLimitAndSortUsingTheGraphApi(
string $user,
string $resource,
string $spaceName,
string $filterType,
string $filterValue,
string $sortType
): void {
$resourceId = $this->spacesContext->getResourceId($user, $spaceName, $resource);
$response = GraphHelper::getActivities(
$this->featureContext->getBaseUrl(),
$this->featureContext->getStepLineRef(),
$user,
$this->featureContext->getPasswordForUser($user),
$resourceId,
[$filterType => $filterValue, 'sort' => $sortType],
);
$this->featureContext->setResponse($response);
}
/**
* @When the administrator gets federated users using the Graph API
* @When user :user tries to get federated users using the Graph API