summaryrefslogtreecommitdiffstats
path: root/build/integration/features/bootstrap
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-04-05 14:51:55 +0200
committerJoas Schilling <coding@schilljs.com>2017-04-07 12:50:47 +0200
commit3d628783d93edc7e067dcaaa3f1883dd84108a85 (patch)
treeb24d1bc785a3c18cd25f028f77612a9a33c92e84 /build/integration/features/bootstrap
parent98312a9a58ad4b4990648d5b4ee9aaf711bca035 (diff)
downloadnextcloud-server-3d628783d93edc7e067dcaaa3f1883dd84108a85.tar.gz
nextcloud-server-3d628783d93edc7e067dcaaa3f1883dd84108a85.zip
Allow to change account info via provisioning api
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'build/integration/features/bootstrap')
-rw-r--r--build/integration/features/bootstrap/Provisioning.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/build/integration/features/bootstrap/Provisioning.php b/build/integration/features/bootstrap/Provisioning.php
index 2e17508120c..94da63a653f 100644
--- a/build/integration/features/bootstrap/Provisioning.php
+++ b/build/integration/features/bootstrap/Provisioning.php
@@ -121,6 +121,32 @@ trait Provisioning {
$client->send($client->createRequest('GET', $url, $options2));
}
+ /**
+ * @Then /^user "([^"]*)" has$/
+ *
+ * @param string $user
+ * @param \Behat\Gherkin\Node\TableNode|null $settings
+ */
+ public function userHasSetting($user, $settings) {
+ $fullUrl = $this->baseUrl . "v{$this->apiVersion}.php/cloud/users/$user";
+ $client = new Client();
+ $options = [];
+ $options['auth'] = $this->adminUser;
+ $options['headers'] = [
+ 'OCS-APIREQUEST' => 'true',
+ ];
+
+ $response = $client->send($client->createRequest("GET", $fullUrl, $options));
+ foreach ($settings->getRows() as $setting) {
+ $value = json_decode(json_encode($response->xml()->data->{$setting[0]}), 1);
+ if (isset($value[0])) {
+ PHPUnit_Framework_Assert::assertEquals($setting[1], $value[0], "", 0.0, 10, true);
+ } else {
+ PHPUnit_Framework_Assert::assertEquals('', $setting[1]);
+ }
+ }
+ }
+
public function createUser($user) {
$previous_user = $this->currentUser;
$this->currentUser = "admin";