]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add basic osc intergration tests 1300/head
authorRoeland Jago Douma <roeland@famdouma.nl>
Wed, 7 Sep 2016 11:01:42 +0000 (13:01 +0200)
committerRoeland Jago Douma <roeland@famdouma.nl>
Wed, 7 Sep 2016 11:04:21 +0000 (13:04 +0200)
build/integration/features/bootstrap/BasicStructure.php
build/integration/features/ocs-v1.feature [new file with mode: 0644]

index e6da74601baa62e25a51b51eaac7e7ce43ec3c99..df46d0b19833eb5cab0536f003d384721470d06b 100644 (file)
@@ -201,6 +201,14 @@ trait BasicStructure {
                PHPUnit_Framework_Assert::assertEquals($statusCode, $this->response->getStatusCode());
        }
 
+       /**
+        * @Then /^the Content-Type should be "([^"]*)"$/
+        * @param string $contentType
+        */
+       public function theContentTypeShouldbe($contentType) {
+               PHPUnit_Framework_Assert::assertEquals($contentType, $this->response->getHeader('Content-Type'));
+       }
+
        /**
         * @param ResponseInterface $response
         */
diff --git a/build/integration/features/ocs-v1.feature b/build/integration/features/ocs-v1.feature
new file mode 100644 (file)
index 0000000..6075189
--- /dev/null
@@ -0,0 +1,24 @@
+Feature: ocs
+  Background:
+    Given using api version "1"
+
+  Scenario: Default output is xml
+    Given user "user0" exists
+    And As an "user0"
+    When sending "GET" to "/cloud/config"
+    And the HTTP status code should be "200"
+    And the Content-Type should be "text/xml; charset=UTF-8"
+
+  Scenario: Get XML when requesting XML
+    Given user "user0" exists
+    And As an "user0"
+    When sending "GET" to "/cloud/config?format=xml"
+    And the HTTP status code should be "200"
+    And the Content-Type should be "text/xml; charset=UTF-8"
+
+  Scenario: Get JSON when requesting JSON
+    Given user "user0" exists
+    And As an "user0"
+    When sending "GET" to "/cloud/config?format=json"
+    And the HTTP status code should be "200"
+    And the Content-Type should be "application/json; charset=utf-8"