summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2016-09-07 13:01:42 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2016-09-07 13:04:21 +0200
commit19ecacd57e9f99736657fb0296a589ed5681da6a (patch)
treea3e21810af220b050cd466c226cdff5007972352 /build
parent240798329d17750dd39463a16ed106b923725fd8 (diff)
downloadnextcloud-server-19ecacd57e9f99736657fb0296a589ed5681da6a.tar.gz
nextcloud-server-19ecacd57e9f99736657fb0296a589ed5681da6a.zip
Add basic osc intergration tests
Diffstat (limited to 'build')
-rw-r--r--build/integration/features/bootstrap/BasicStructure.php8
-rw-r--r--build/integration/features/ocs-v1.feature24
2 files changed, 32 insertions, 0 deletions
diff --git a/build/integration/features/bootstrap/BasicStructure.php b/build/integration/features/bootstrap/BasicStructure.php
index e6da74601ba..df46d0b1983 100644
--- a/build/integration/features/bootstrap/BasicStructure.php
+++ b/build/integration/features/bootstrap/BasicStructure.php
@@ -202,6 +202,14 @@ trait BasicStructure {
}
/**
+ * @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
*/
private function extracRequestTokenFromResponse(ResponseInterface $response) {
diff --git a/build/integration/features/ocs-v1.feature b/build/integration/features/ocs-v1.feature
new file mode 100644
index 00000000000..6075189ddb4
--- /dev/null
+++ b/build/integration/features/ocs-v1.feature
@@ -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"