fix api tests
This commit is contained in:
@@ -19,7 +19,7 @@ require (
|
|||||||
github.com/blevesearch/bleve/v2 v2.2.2
|
github.com/blevesearch/bleve/v2 v2.2.2
|
||||||
github.com/coreos/go-oidc/v3 v3.1.0
|
github.com/coreos/go-oidc/v3 v3.1.0
|
||||||
github.com/cs3org/go-cs3apis v0.0.0-20211104090126-8e972dca8304
|
github.com/cs3org/go-cs3apis v0.0.0-20211104090126-8e972dca8304
|
||||||
github.com/cs3org/reva v1.17.0
|
github.com/cs3org/reva v1.17.1-0.20211212151213-778de37266ff
|
||||||
github.com/disintegration/imaging v1.6.2
|
github.com/disintegration/imaging v1.6.2
|
||||||
github.com/glauth/glauth/v2 v2.0.0-20211021011345-ef3151c28733
|
github.com/glauth/glauth/v2 v2.0.0-20211021011345-ef3151c28733
|
||||||
github.com/go-chi/chi/v5 v5.0.7
|
github.com/go-chi/chi/v5 v5.0.7
|
||||||
|
|||||||
@@ -11,9 +11,9 @@ Feature: Change data of space
|
|||||||
And the administrator has given "Alice" the role "Admin" using the settings api
|
And the administrator has given "Alice" the role "Admin" using the settings api
|
||||||
|
|
||||||
Scenario: Alice changes a name of the space via the Graph api, she expects a 204 code and checks that the space name has changed
|
Scenario: Alice changes a name of the space via the Graph api, she expects a 204 code and checks that the space name has changed
|
||||||
Given user "Alice" has created a space "Project Jupiter" of type "project" with quota "20"
|
Given user "Alice" has created a space "Project Jupiter" of type "project" with quota "20"
|
||||||
When user "Alice" changes the name of the "Project Jupiter" space to "Project Death Star"
|
When user "Alice" changes the name of the "Project Jupiter" space to "Project Death Star"
|
||||||
Then the HTTP status code should be "204"
|
Then the HTTP status code should be "200"
|
||||||
When user "Alice" lists all available spaces via the GraphApi
|
When user "Alice" lists all available spaces via the GraphApi
|
||||||
Then the json responded should contain a space "Project Death Star" with these key and value pairs:
|
Then the json responded should contain a space "Project Death Star" with these key and value pairs:
|
||||||
| key | value |
|
| key | value |
|
||||||
@@ -23,12 +23,11 @@ Feature: Change data of space
|
|||||||
| root@@@webDavUrl | %base_url%/dav/spaces/%space_id% |
|
| root@@@webDavUrl | %base_url%/dav/spaces/%space_id% |
|
||||||
|
|
||||||
Scenario: Alice increases quota of the space via the Graph api, she expects a 204 code and checks that the quota has changed
|
Scenario: Alice increases quota of the space via the Graph api, she expects a 204 code and checks that the quota has changed
|
||||||
Given user "Alice" has created a space "Project Earth" of type "project" with quota "20"
|
Given user "Alice" has created a space "Project Earth" of type "project" with quota "20"
|
||||||
When user "Alice" changes the quota of the "Project Earth" space to "100"
|
When user "Alice" changes the quota of the "Project Earth" space to "100"
|
||||||
Then the HTTP status code should be "204"
|
Then the HTTP status code should be "200"
|
||||||
When user "Alice" lists all available spaces via the GraphApi
|
When user "Alice" lists all available spaces via the GraphApi
|
||||||
Then the json responded should contain a space "Project Earth" with these key and value pairs:
|
Then the json responded should contain a space "Project Earth" with these key and value pairs:
|
||||||
| key | value |
|
| key | value |
|
||||||
| name | Project Earth |
|
| name | Project Earth |
|
||||||
| quota@@@total | 100 |
|
| quota@@@total | 100 |
|
||||||
|
|
||||||
@@ -187,11 +187,11 @@ class SpacesContext implements Context {
|
|||||||
*/
|
*/
|
||||||
public function getSpaceByName(string $user, string $name): array {
|
public function getSpaceByName(string $user, string $name): array {
|
||||||
$this->theUserListsAllHisAvailableSpacesUsingTheGraphApi($user);
|
$this->theUserListsAllHisAvailableSpacesUsingTheGraphApi($user);
|
||||||
|
|
||||||
$spaces = $this->getAvailableSpaces();
|
$spaces = $this->getAvailableSpaces();
|
||||||
Assert::assertIsArray($spaces[$name], "Space with name $name for user $user not found");
|
Assert::assertIsArray($spaces[$name], "Space with name $name for user $user not found");
|
||||||
Assert::assertNotEmpty($spaces[$name]["root"]["webDavUrl"], "WebDavUrl for space with name $name for user $user not found");
|
Assert::assertNotEmpty($spaces[$name]["root"]["webDavUrl"], "WebDavUrl for space with name $name for user $user not found");
|
||||||
|
|
||||||
return $spaces[$name];
|
return $spaces[$name];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -802,7 +802,7 @@ class SpacesContext implements Context {
|
|||||||
string $spaceName
|
string $spaceName
|
||||||
): void {
|
): void {
|
||||||
$space = $this->getSpaceByName($user, $spaceName);
|
$space = $this->getSpaceByName($user, $spaceName);
|
||||||
|
|
||||||
$baseUrl = $this->featureContext->getBaseUrl();
|
$baseUrl = $this->featureContext->getBaseUrl();
|
||||||
if (!str_ends_with($baseUrl, '/')) {
|
if (!str_ends_with($baseUrl, '/')) {
|
||||||
$baseUrl .= '/';
|
$baseUrl .= '/';
|
||||||
@@ -838,7 +838,7 @@ class SpacesContext implements Context {
|
|||||||
string $ownerUser
|
string $ownerUser
|
||||||
): void {
|
): void {
|
||||||
$space = $this->getSpaceByName($ownerUser, $spaceName);
|
$space = $this->getSpaceByName($ownerUser, $spaceName);
|
||||||
|
|
||||||
$baseUrl = $this->featureContext->getBaseUrl();
|
$baseUrl = $this->featureContext->getBaseUrl();
|
||||||
if (!str_ends_with($baseUrl, '/')) {
|
if (!str_ends_with($baseUrl, '/')) {
|
||||||
$baseUrl .= '/';
|
$baseUrl .= '/';
|
||||||
@@ -1044,7 +1044,7 @@ class SpacesContext implements Context {
|
|||||||
if (!str_ends_with($fullUrl, '/')) {
|
if (!str_ends_with($fullUrl, '/')) {
|
||||||
$fullUrl .= '/';
|
$fullUrl .= '/';
|
||||||
}
|
}
|
||||||
$fullUrl .= "graph/v1.0/Drive($spaceId)";
|
$fullUrl .= "graph/v1.0/drives/$spaceId";
|
||||||
$method = 'PATCH';
|
$method = 'PATCH';
|
||||||
|
|
||||||
return HttpRequestHelper::sendRequest($fullUrl, $xRequestId, $method, $user, $password, $headers, $body);
|
return HttpRequestHelper::sendRequest($fullUrl, $xRequestId, $method, $user, $password, $headers, $body);
|
||||||
@@ -1090,7 +1090,7 @@ class SpacesContext implements Context {
|
|||||||
*/
|
*/
|
||||||
public function userHasUploadedFile(string $user, string $spaceName, string $fileContent, string $destination):void {
|
public function userHasUploadedFile(string $user, string $spaceName, string $fileContent, string $destination):void {
|
||||||
$this->theUserListsAllHisAvailableSpacesUsingTheGraphApi($user);
|
$this->theUserListsAllHisAvailableSpacesUsingTheGraphApi($user);
|
||||||
|
|
||||||
$space = $this->getSpaceByName($user, $spaceName);
|
$space = $this->getSpaceByName($user, $spaceName);
|
||||||
Assert::assertIsArray($space, "Space with name $spaceName not found");
|
Assert::assertIsArray($space, "Space with name $spaceName not found");
|
||||||
Assert::assertNotEmpty($space["root"]["webDavUrl"], "WebDavUrl for space with name $spaceName not found");
|
Assert::assertNotEmpty($space["root"]["webDavUrl"], "WebDavUrl for space with name $spaceName not found");
|
||||||
|
|||||||
Reference in New Issue
Block a user