mirror of
https://github.com/owncloud/ocis
synced 2026-04-25 17:25:21 +02:00
add tests to check activites of space after updating public share link
Signed-off-by: prashant-gurung899 <prasantgrg777@gmail.com>
This commit is contained in:
@@ -26,6 +26,7 @@ require_once 'bootstrap.php';
|
||||
*/
|
||||
class GraphContext implements Context {
|
||||
private FeatureContext $featureContext;
|
||||
private SpacesContext $spacesContext;
|
||||
|
||||
/**
|
||||
* application Entity
|
||||
@@ -47,6 +48,7 @@ class GraphContext implements Context {
|
||||
$environment = $scope->getEnvironment();
|
||||
// Get all the contexts you need in this context from here
|
||||
$this->featureContext = $environment->getContext('FeatureContext');
|
||||
$this->spacesContext = $environment->getContext('SpacesContext');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2891,6 +2893,47 @@ class GraphContext implements Context {
|
||||
$this->featureContext->setResponse($response);
|
||||
}
|
||||
|
||||
/**
|
||||
* @When the public tries to check the activities of space :spaceName owned by user :user with password :password using the Graph API
|
||||
*
|
||||
* @param string $spaceName
|
||||
* @param string $user
|
||||
* @param string $password
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function thePublicTriesToCheckTheActivitiesOfSpaceOwnedByUserWithPasswordUsingGraphApi(string $spaceName, string $user, string $password): void {
|
||||
$response = GraphHelper::getActivities(
|
||||
$this->featureContext->getBaseUrl(),
|
||||
$this->featureContext->getStepLineRef(),
|
||||
"public",
|
||||
$this->featureContext->getActualPassword($password),
|
||||
$this->spacesContext->getSpaceIdByName($user, $spaceName)
|
||||
);
|
||||
$this->featureContext->setResponse($response);
|
||||
}
|
||||
|
||||
/**
|
||||
* @When /^the public tries to check the activities of (?:folder|file) "([^"]*)" from space "([^"]*)" owned by user "([^"]*)" with password "([^"]*)" using the Graph API$/
|
||||
*
|
||||
* @param string $resource
|
||||
* @param string $space
|
||||
* @param string $owner
|
||||
* @param string $password
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function thePublicTriesToCheckTheActivitiesOfResourceFromSpaceOwnedByUserWithPasswordUsingGraphApi(string $resource, string $space, string $owner, string $password): void {
|
||||
$response = GraphHelper::getActivities(
|
||||
$this->featureContext->getBaseUrl(),
|
||||
$this->featureContext->getStepLineRef(),
|
||||
"public",
|
||||
$this->featureContext->getPasswordForUser($owner),
|
||||
$this->spacesContext->getResourceId($owner, $space, $resource)
|
||||
);
|
||||
$this->featureContext->setResponse($response);
|
||||
}
|
||||
|
||||
/**
|
||||
* @When /^user "([^"]*)" lists the activities of (?:folder|file) "([^"]*)" from space "([^"]*)" with (depth|limit) "([^"]*)" using the Graph API/
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user