Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d5c1df1c88 |
No files matched your search
@@ -793,6 +793,40 @@ class SpacesContext implements Context {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @When /^user "([^"]*)" (?:creates|tries to create) a space "([^"]*)" of type "([^"]*)" with id "([^"]*)" using the Graph API$/
|
||||
*
|
||||
* @param string $user
|
||||
* @param string $spaceName
|
||||
* @param string $spaceType
|
||||
* @param string $spaceId
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws GuzzleException
|
||||
* @throws Exception
|
||||
*/
|
||||
public function theUserCreatesASpaceWithIdUsingTheGraphApi(
|
||||
string $user,
|
||||
string $spaceName,
|
||||
string $spaceType,
|
||||
string $spaceId,
|
||||
): void {
|
||||
$space = ["name" => $spaceName, "driveType" => $spaceType, "id" => $spaceId];
|
||||
$body = json_encode($space);
|
||||
$response = GraphHelper::createSpace(
|
||||
$this->featureContext->getBaseUrl(),
|
||||
$user,
|
||||
$this->featureContext->getPasswordForUser($user),
|
||||
$body,
|
||||
);
|
||||
$this->featureContext->setResponse($response);
|
||||
if ($response->getStatusCode() === 201) {
|
||||
$space = $this->featureContext->getJsonDecodedResponseBodyContent($response);
|
||||
$this->addToCreatedSpace($user, $space);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $user
|
||||
* @param string $spaceName
|
||||
|
||||
@@ -153,3 +153,51 @@ Feature: create space
|
||||
| user-role |
|
||||
| Admin |
|
||||
| Space Admin |
|
||||
|
||||
@issue-11235
|
||||
Scenario: admin user creates a space with a caller-supplied id via the Graph API
|
||||
Given the administrator has assigned the role "Admin" to user "Alice" using the Graph API
|
||||
When user "Alice" creates a space "Project Saturn" of type "project" with id "11111111-1111-4111-8111-111111111111" using the Graph API
|
||||
Then the HTTP status code should be "201"
|
||||
And the JSON response should contain space called "Project Saturn" and match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"name",
|
||||
"id",
|
||||
"root",
|
||||
"webUrl"
|
||||
],
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"enum": ["Project Saturn"]
|
||||
},
|
||||
"driveType": {
|
||||
"type": "string",
|
||||
"enum": ["project"]
|
||||
},
|
||||
"id": {
|
||||
"type": "string",
|
||||
"pattern": "^%user_id_pattern%\\$11111111-1111-4111-8111-111111111111$"
|
||||
},
|
||||
"root": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"webDavUrl"
|
||||
],
|
||||
"properties": {
|
||||
"webDavUrl": {
|
||||
"type": "string",
|
||||
"pattern": "^%base_url%/dav/spaces/%user_id_pattern%\\$11111111-1111-4111-8111-111111111111$"
|
||||
}
|
||||
}
|
||||
},
|
||||
"webUrl": {
|
||||
"type": "string",
|
||||
"pattern": "^%base_url%/f/%user_id_pattern%\\$11111111-1111-4111-8111-111111111111$"
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
Reference in new issue
Block a user