mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-04-24 21:18:19 -05:00
add test to check api activities with sort filter
Signed-off-by: prashant-gurung899 <prasantgrg777@gmail.com>
This commit is contained in:
@@ -2935,7 +2935,7 @@ class GraphContext implements Context {
|
||||
}
|
||||
|
||||
/**
|
||||
* @When /^user "([^"]*)" lists the activities of (?:folder|file) "([^"]*)" from space "([^"]*)" with (depth|limit) "([^"]*)" 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
|
||||
@@ -2958,6 +2958,26 @@ class GraphContext implements Context {
|
||||
$this->featureContext->setResponse($response);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then the activities should be in the following order:
|
||||
*
|
||||
* @param TableNode $table
|
||||
*
|
||||
* @return void
|
||||
* @throws Exception
|
||||
*/
|
||||
public function theActivitiesShouldBeInTheFollowingOrder(TableNode $table): void {
|
||||
$responseBody = $this->featureContext->getJsonDecodedResponseBodyContent();
|
||||
$activities = $responseBody->value;
|
||||
|
||||
foreach ($table->getHash() as $index => $expectedValue) {
|
||||
$actualActivity = $activities[$index];
|
||||
$expectedActivity = $expectedValue['resource'] . ":" . $expectedValue['message'];
|
||||
$actualActivity = $actualActivity->template->variables->resource->name . ":" . $actualActivity->template->message;
|
||||
Assert::assertEquals($expectedActivity, $actualActivity, "Activity didn't match");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @When the administrator gets federated users using the Graph API
|
||||
* @When user :user tries to get federated users using the Graph API
|
||||
|
||||
Reference in New Issue
Block a user