From 8e99f19c2833142543f893c784173e9891d27be2 Mon Sep 17 00:00:00 2001 From: Sergio Bertolin Date: Tue, 10 Jan 2017 15:55:00 +0000 Subject: Added tests using v2.php Signed-off-by: Morris Jobke --- build/integration/features/bootstrap/AppConfiguration.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'build/integration/features/bootstrap') diff --git a/build/integration/features/bootstrap/AppConfiguration.php b/build/integration/features/bootstrap/AppConfiguration.php index 2f84dce3f1b..5752150e8d6 100644 --- a/build/integration/features/bootstrap/AppConfiguration.php +++ b/build/integration/features/bootstrap/AppConfiguration.php @@ -62,13 +62,17 @@ trait AppConfiguration { $body = new \Behat\Gherkin\Node\TableNode([['value', $value]]); $this->sendingToWith('post', "/apps/testing/api/v1/app/{$app}/{$parameter}", $body); $this->theHTTPStatusCodeShouldBe('200'); - $this->theOCSStatusCodeShouldBe('100'); + if ($this->apiVersion == 1) { + $this->theOCSStatusCodeShouldBe('100'); + } } protected function setStatusTestingApp($enabled) { $this->sendingTo(($enabled ? 'post' : 'delete'), '/cloud/apps/testing'); $this->theHTTPStatusCodeShouldBe('200'); - $this->theOCSStatusCodeShouldBe('100'); + if ($this->apiVersion == 1) { + $this->theOCSStatusCodeShouldBe('100'); + } $this->sendingTo('get', '/cloud/apps?filter=enabled'); $this->theHTTPStatusCodeShouldBe('200'); -- cgit v1.2.3 From 4626514a35510a6c730fd1d484936524012f44d8 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 17 Mar 2017 11:07:51 +0100 Subject: Strict comparisons Signed-off-by: Joas Schilling --- build/integration/features/bootstrap/AppConfiguration.php | 4 ++-- build/integration/features/bootstrap/BasicStructure.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'build/integration/features/bootstrap') diff --git a/build/integration/features/bootstrap/AppConfiguration.php b/build/integration/features/bootstrap/AppConfiguration.php index 5752150e8d6..39fee5e361a 100644 --- a/build/integration/features/bootstrap/AppConfiguration.php +++ b/build/integration/features/bootstrap/AppConfiguration.php @@ -62,7 +62,7 @@ trait AppConfiguration { $body = new \Behat\Gherkin\Node\TableNode([['value', $value]]); $this->sendingToWith('post', "/apps/testing/api/v1/app/{$app}/{$parameter}", $body); $this->theHTTPStatusCodeShouldBe('200'); - if ($this->apiVersion == 1) { + if ($this->apiVersion === 1) { $this->theOCSStatusCodeShouldBe('100'); } } @@ -70,7 +70,7 @@ trait AppConfiguration { protected function setStatusTestingApp($enabled) { $this->sendingTo(($enabled ? 'post' : 'delete'), '/cloud/apps/testing'); $this->theHTTPStatusCodeShouldBe('200'); - if ($this->apiVersion == 1) { + if ($this->apiVersion === 1) { $this->theOCSStatusCodeShouldBe('100'); } diff --git a/build/integration/features/bootstrap/BasicStructure.php b/build/integration/features/bootstrap/BasicStructure.php index 8961efc6f31..ec23916d614 100644 --- a/build/integration/features/bootstrap/BasicStructure.php +++ b/build/integration/features/bootstrap/BasicStructure.php @@ -83,11 +83,11 @@ trait BasicStructure { } /** - * @Given /^using api version "([^"]*)"$/ + * @Given /^using api version "(\d+)"$/ * @param string $version */ public function usingApiVersion($version) { - $this->apiVersion = $version; + $this->apiVersion = (int) $version; } /** -- cgit v1.2.3 From 4157e7914ab4d9eb72ac0eecf4ed5c5fcaef89a5 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 17 Mar 2017 14:38:27 +0100 Subject: Fix deletion of groups Signed-off-by: Joas Schilling --- build/integration/features/bootstrap/Provisioning.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'build/integration/features/bootstrap') diff --git a/build/integration/features/bootstrap/Provisioning.php b/build/integration/features/bootstrap/Provisioning.php index 0055ff15de0..2e17508120c 100644 --- a/build/integration/features/bootstrap/Provisioning.php +++ b/build/integration/features/bootstrap/Provisioning.php @@ -331,6 +331,12 @@ trait Provisioning { ]; $this->response = $client->send($client->createRequest("DELETE", $fullUrl, $options)); + + if ($this->currentServer === 'LOCAL'){ + unset($this->createdGroups[$group]); + } elseif ($this->currentServer === 'REMOTE') { + unset($this->createdRemoteGroups[$group]); + } } /** @@ -748,7 +754,7 @@ trait Provisioning { } $this->usingServer('REMOTE'); foreach($this->createdRemoteGroups as $remoteGroup) { - $this->deleteUser($remoteGroup); + $this->deleteGroup($remoteGroup); } $this->usingServer($previousServer); } -- cgit v1.2.3