diff options
author | Sergio Bertolin <sbertolin@solidgear.es> | 2015-10-07 09:03:00 +0000 |
---|---|---|
committer | Sergio Bertolin <sbertolin@solidgear.es> | 2015-10-07 09:03:00 +0000 |
commit | 1b0e128b4407fefe9ff7be7366bacbac94d101c9 (patch) | |
tree | 6e4cd4fde7abed731c92a7e19b26782e59a0e2ce /build | |
parent | bb9f5686543531ccb55a59eb003cd6f83991b398 (diff) | |
download | nextcloud-server-1b0e128b4407fefe9ff7be7366bacbac94d101c9.tar.gz nextcloud-server-1b0e128b4407fefe9ff7be7366bacbac94d101c9.zip |
checking users and groups
Diffstat (limited to 'build')
-rw-r--r-- | build/integration/features/bootstrap/FeatureContext.php | 24 | ||||
-rw-r--r-- | build/integration/features/provisioning-v1.feature | 9 |
2 files changed, 23 insertions, 10 deletions
diff --git a/build/integration/features/bootstrap/FeatureContext.php b/build/integration/features/bootstrap/FeatureContext.php index 99d030fa6fc..a09e74de57c 100644 --- a/build/integration/features/bootstrap/FeatureContext.php +++ b/build/integration/features/bootstrap/FeatureContext.php @@ -49,7 +49,6 @@ class FeatureContext extends BehatContext { $this->sendingToWith($verb, $url, null); } - /** * Parses the xml answer to get ocs response which doesn't match with * http one in v1 of the api. @@ -67,19 +66,14 @@ class FeatureContext extends BehatContext { return $extractedElementsArray; } - /** * Parses the xml answer to get the array of groups returned. */ - /* - public function getArrayOfGroupsResponded(){ - $listCheckedElements = $this->$response->xml()->data[0]->groups[0]->element; + public function getArrayOfGroupsResponded($resp) { + $listCheckedElements = $resp->xml()->data[0]->groups[0]->element; $extractedElementsArray = json_decode( json_encode($listCheckedElements) , 1); return $extractedElementsArray; } - */ - - /** * @Then /^users returned are$/ @@ -93,9 +87,21 @@ class FeatureContext extends BehatContext { } } - /** + * @Then /^groups returned are$/ + * @param \Behat\Gherkin\Node\TableNode|null $formData + */ + public function theGroupsShouldBe($groupsList) { + if ($groupsList instanceof \Behat\Gherkin\Node\TableNode) { + $groups = $groupsList->getRows()[0]; + $respondedArray = $this->getArrayOfGroupsResponded($this->response); + PHPUnit_Framework_Assert::assertEquals($groups, $respondedArray); + } + + } + + /** * @Then /^the OCS status code should be "([^"]*)"$/ */ public function theOCSStatusCodeShouldBe($statusCode) { diff --git a/build/integration/features/provisioning-v1.feature b/build/integration/features/provisioning-v1.feature index 448c06b8b51..ad6841142a9 100644 --- a/build/integration/features/provisioning-v1.feature +++ b/build/integration/features/provisioning-v1.feature @@ -44,7 +44,7 @@ Feature: provisioning Given As an "admin" When sending "GET" to "/cloud/users" And users returned are - | brand-new-user | ser507 | + | brand-new-user | admin | Scenario: Edit a user @@ -81,6 +81,13 @@ Feature: provisioning And group "new-group" exists + Scenario: Getting all users + Given As an "admin" + When sending "GET" to "/cloud/groups" + And groups returned are + | admin | new-group | + + Scenario: Delete a group Given As an "admin" And group "new-group" exists |