Skip to content

Commit

Permalink
fix after review
Browse files Browse the repository at this point in the history
  • Loading branch information
ScharfViktor committed Feb 11, 2022
1 parent 85714c1 commit 493ec78
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tests/acceptance/features/apiSpaces/shareSpaces.feature
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Feature: Share spaces
Given user "Alice" has created a space "Share space to Brian" of type "project" with quota "10"
And user "Alice" has shared a space "Share space to Brian" to user "Brian" with role "viewer"
When user "Alice" lists all available spaces via the GraphApi
And the json responded should contain a space "Share space to Brian" granted to "Brian" with these key and value pairs:
Then the json responded should contain a space "Share space to Brian" granted to "Brian" with these key and value pairs:
| key | value |
| root@@@permissions@@@1@@@grantedTo@@@0@@@user@@@id | %user_id% |
| root@@@permissions@@@1@@@roles@@@0 | viewer |
Expand Down
15 changes: 9 additions & 6 deletions tests/acceptance/features/bootstrap/SpacesContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,11 @@ public function getUserIdByUserName(string $userName): string {
);
if ($this->featureContext->getResponse()) {
$rawBody = $this->featureContext->getResponse()->getBody()->getContents();
if (isset(\json_decode($rawBody, true, 512, JSON_THROW_ON_ERROR)["accounts"])) {
$accounts = \json_decode($rawBody, true, 512, JSON_THROW_ON_ERROR)["accounts"];
$response = \json_decode($rawBody, true, 512, JSON_THROW_ON_ERROR);
if (isset($response["accounts"])) {
$accounts = $response["accounts"];
} else {
throw new Exception(__METHOD__ . " accounts-list is empty");
}
}
foreach ($accounts as $account) {
Expand Down Expand Up @@ -1530,18 +1533,18 @@ public function sendDeleteSpaceRequest(
*
* @param string $user
* @param string $spaceName
* @param string $userWithManagerRigths
* @param string $userWithManagerRights
*
* @return void
* @throws GuzzleException
*/
public function sendRestoreSpaceRequest(
string $user,
string $spaceName,
string $userWithManagerRigths = ''
string $userWithManagerRights = ''
): void {
if (!empty($userWithManagerRigths)) {
$space = $this->getSpaceByName($userWithManagerRigths, $spaceName);
if (!empty($userWithManagerRights)) {
$space = $this->getSpaceByName($userWithManagerRights, $spaceName);
} else {
$space = $this->getSpaceByName($user, $spaceName);
}
Expand Down

0 comments on commit 493ec78

Please sign in to comment.