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:
authorDries Mys <dries.mys@my-dreams.be>2021-06-01 02:13:40 +0300
committerDries Mys <dries.mys@my-dreams.be>2021-06-05 23:22:39 +0300
commitbefd0452b289502bf7a7e9e30217cc30efd4cc00 (patch)
tree69ad532eb9eafcaf3f818558f2d1162afcd845e8 /build
parentcb95b8de3f41f852c90a1add2189c8928234c1eb (diff)
Added tests for specifying custom display name during group creation.
Signed-off-by: Dries Mys <dries.mys@my-dreams.be>
Diffstat (limited to 'build')
-rw-r--r--build/integration/features/bootstrap/Provisioning.php32
-rw-r--r--build/integration/features/provisioning-v1.feature17
2 files changed, 49 insertions, 0 deletions
diff --git a/build/integration/features/bootstrap/Provisioning.php b/build/integration/features/bootstrap/Provisioning.php
index dd8e3a2a150..8eab793d66b 100644
--- a/build/integration/features/bootstrap/Provisioning.php
+++ b/build/integration/features/bootstrap/Provisioning.php
@@ -175,6 +175,38 @@ trait Provisioning {
}
}
}
+
+ /**
+ * @Then /^group "([^"]*)" has$/
+ *
+ * @param string $user
+ * @param \Behat\Gherkin\Node\TableNode|null $settings
+ */
+ public function groupHasSetting($group, $settings) {
+ $fullUrl = $this->baseUrl . "v{$this->apiVersion}.php/cloud/groups/details?search=$group";
+ $client = new Client();
+ $options = [];
+ if ($this->currentUser === 'admin') {
+ $options['auth'] = $this->adminUser;
+ } else {
+ $options['auth'] = [$this->currentUser, $this->regularUser];
+ }
+ $options['headers'] = [
+ 'OCS-APIREQUEST' => 'true',
+ ];
+
+ $response = $client->get($fullUrl, $options);
+ $groupDetails = simplexml_load_string($response->getBody())->data[0]->groups[0]->element;
+ foreach ($settings->getRows() as $setting) {
+ $value = json_decode(json_encode($groupDetails->{$setting[0]}), 1);
+ if (isset($value[0])) {
+ Assert::assertEquals($setting[1], $value[0], "", 0.0, 10, true);
+ } else {
+ Assert::assertEquals('', $setting[1]);
+ }
+ }
+ }
+
/**
* @Then /^user "([^"]*)" has editable fields$/
diff --git a/build/integration/features/provisioning-v1.feature b/build/integration/features/provisioning-v1.feature
index e56c86a2d4f..dec6d2213e3 100644
--- a/build/integration/features/provisioning-v1.feature
+++ b/build/integration/features/provisioning-v1.feature
@@ -231,6 +231,21 @@ Feature: provisioning
Then the OCS status code should be "100"
And the HTTP status code should be "200"
And group "new-group" exists
+ And group "new-group" has
+ | displayname | new-group |
+
+ Scenario: Create a group with custom display name
+ Given As an "admin"
+ And group "new-group" does not exist
+ When sending "POST" to "/cloud/groups" with
+ | groupid | new-group |
+ | password | 123456 |
+ | displayname | new-group-displayname |
+ Then the OCS status code should be "100"
+ And the HTTP status code should be "200"
+ And group "new-group" exists
+ And group "new-group" has
+ | displayname | new-group-displayname |
Scenario: Create a group with special characters
Given As an "admin"
@@ -241,6 +256,8 @@ Feature: provisioning
Then the OCS status code should be "100"
And the HTTP status code should be "200"
And group "España" exists
+ And group "España" has
+ | displayname | España |
Scenario: adding user to a group without sending the group
Given As an "admin"