Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorSergio Bertolin <sbertolin@solidgear.es>2016-08-16 13:40:30 +0300
committerSergio BertolĂ­n <sbertolin@solidgear.es>2016-08-26 16:08:51 +0300
commitb06f21158c7b4667a89b2125dfd5f18cf2faaa73 (patch)
treeab74215adcfe561a237ad1890e637ce01876b2a1 /build
parent7dcad089090c0c5b5789e6e6f13146e968fa8512 (diff)
Only check the pertenence to groups
Diffstat (limited to 'build')
-rw-r--r--build/integration/features/bootstrap/Provisioning.php20
-rw-r--r--build/integration/features/provisioning-v1.feature8
2 files changed, 24 insertions, 4 deletions
diff --git a/build/integration/features/bootstrap/Provisioning.php b/build/integration/features/bootstrap/Provisioning.php
index 6cf57514483..f4ac9f3346a 100644
--- a/build/integration/features/bootstrap/Provisioning.php
+++ b/build/integration/features/bootstrap/Provisioning.php
@@ -150,6 +150,26 @@ trait Provisioning {
PHPUnit_Framework_Assert::assertEquals(200, $this->response->getStatusCode());
}
+ /**
+ * @Then /^check that user "([^"]*)" does not belong to group "([^"]*)"$/
+ * @param string $user
+ * @param string $group
+ */
+ public function checkThatUserDoesNotBelongToGroup($user, $group) {
+ $fullUrl = $this->baseUrl . "v2.php/cloud/users/$user/groups";
+ $client = new Client();
+ $options = [];
+ if ($this->currentUser === 'admin') {
+ $options['auth'] = $this->adminUser;
+ }
+
+ $this->response = $client->get($fullUrl, $options);
+ $respondedArray = $this->getArrayOfGroupsResponded($this->response);
+ sort($respondedArray);
+ PHPUnit_Framework_Assert::assertNotContains($group, $respondedArray);
+ PHPUnit_Framework_Assert::assertEquals(200, $this->response->getStatusCode());
+ }
+
public function userBelongsToGroup($user, $group) {
$fullUrl = $this->baseUrl . "v2.php/cloud/users/$user/groups";
$client = new Client();
diff --git a/build/integration/features/provisioning-v1.feature b/build/integration/features/provisioning-v1.feature
index 26e466118d3..6c0c4e8c446 100644
--- a/build/integration/features/provisioning-v1.feature
+++ b/build/integration/features/provisioning-v1.feature
@@ -327,7 +327,7 @@ Feature: provisioning
| groupid | new-group |
Then the OCS status code should be "100"
And the HTTP status code should be "200"
- And user "brand-new-user" belongs to group "new-group"
+ And check that user "brand-new-user" belongs to group "new-group"
Scenario: a subadmin cannot add users to groups the subadmin is not responsible for
Given As an "admin"
@@ -342,7 +342,7 @@ Feature: provisioning
Then the OCS status code should be "104"
And the HTTP status code should be "200"
And As an "admin"
- And user "brand-new-user" does not belongs to group "new-group"
+ And check that user "brand-new-user" does not belongs to group "new-group"
Scenario: a subadmin can remove users to groups the subadmin is responsible for
Given As an "admin"
@@ -357,7 +357,7 @@ Feature: provisioning
Then the OCS status code should be "100"
And the HTTP status code should be "200"
And As an "admin"
- And user "brand-new-user" does not belong to group "new-group"
+ And check that user "brand-new-user" does not belong to group "new-group"
Scenario: a subadmin cannot remove users to groups the subadmin is not responsible for
Given As an "admin"
@@ -373,7 +373,7 @@ Feature: provisioning
Then the OCS status code should be "104"
And the HTTP status code should be "200"
And As an "admin"
- And user "brand-new-user" belongs to group "new-group"
+ And check that user "brand-new-user" belongs to group "new-group"
Scenario: Making a web request with an enabled user
Given As an "admin"