diff --git a/tests/acceptance/features/apiSpaces/shareSpaces.feature b/tests/acceptance/features/apiSpaces/shareSpaces.feature index df41dd452..70704abdd 100644 --- a/tests/acceptance/features/apiSpaces/shareSpaces.feature +++ b/tests/acceptance/features/apiSpaces/shareSpaces.feature @@ -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 | diff --git a/tests/acceptance/features/bootstrap/SpacesContext.php b/tests/acceptance/features/bootstrap/SpacesContext.php index fbcf2b7c4..67c6c55f2 100644 --- a/tests/acceptance/features/bootstrap/SpacesContext.php +++ b/tests/acceptance/features/bootstrap/SpacesContext.php @@ -227,8 +227,11 @@ class SpacesContext implements Context { ); 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) { @@ -1530,7 +1533,7 @@ class SpacesContext implements Context { * * @param string $user * @param string $spaceName - * @param string $userWithManagerRigths + * @param string $userWithManagerRights * * @return void * @throws GuzzleException @@ -1538,10 +1541,10 @@ class SpacesContext implements Context { 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); }