test against OCS v2 instead

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
Arthur Schiwon 2017-01-19 12:48:50 +01:00
parent 01d469dfea
commit f2c9d04eac
No known key found for this signature in database
GPG Key ID: 7424F1874854DF23
2 changed files with 13 additions and 19 deletions

View File

@ -76,7 +76,7 @@ class ConfigAPIController extends OCSController {
* creates a new (empty) configuration and returns the resulting prefix * creates a new (empty) configuration and returns the resulting prefix
* *
* Example: curl -X POST -H "OCS-APIREQUEST: true" -u $admin:$password \ * Example: curl -X POST -H "OCS-APIREQUEST: true" -u $admin:$password \
* https://nextcloud.server/ocs/v1.php/apps/user_ldap/api/v1/config * https://nextcloud.server/ocs/v2.php/apps/user_ldap/api/v1/config
* *
* results in: * results in:
* *
@ -84,10 +84,8 @@ class ConfigAPIController extends OCSController {
* <ocs> * <ocs>
* <meta> * <meta>
* <status>ok</status> * <status>ok</status>
* <statuscode>100</statuscode> * <statuscode>200</statuscode>
* <message>OK</message> * <message>OK</message>
* <totalitems></totalitems>
* <itemsperpage></itemsperpage>
* </meta> * </meta>
* <data> * <data>
* <configID>s40</configID> * <configID>s40</configID>
@ -103,8 +101,6 @@ class ConfigAPIController extends OCSController {
* <status>failure</status> * <status>failure</status>
* <statuscode>999</statuscode> * <statuscode>999</statuscode>
* <message>An issue occurred when creating the new config.</message> * <message>An issue occurred when creating the new config.</message>
* <totalitems></totalitems>
* <itemsperpage></itemsperpage>
* </meta> * </meta>
* <data/> * <data/>
* </ocs> * </ocs>
@ -131,7 +127,7 @@ class ConfigAPIController extends OCSController {
* *
* Example: * Example:
* curl -X DELETE -H "OCS-APIREQUEST: true" -u $admin:$password \ * curl -X DELETE -H "OCS-APIREQUEST: true" -u $admin:$password \
* https://nextcloud.server/ocs/v1.php/apps/user_ldap/api/v1/config/s60 * https://nextcloud.server/ocs/v2.php/apps/user_ldap/api/v1/config/s60
* *
* <?xml version="1.0"?> * <?xml version="1.0"?>
* <ocs> * <ocs>
@ -139,8 +135,6 @@ class ConfigAPIController extends OCSController {
* <status>ok</status> * <status>ok</status>
* <statuscode>100</statuscode> * <statuscode>100</statuscode>
* <message>OK</message> * <message>OK</message>
* <totalitems></totalitems>
* <itemsperpage></itemsperpage>
* </meta> * </meta>
* <data/> * <data/>
* </ocs> * </ocs>
@ -178,7 +172,7 @@ class ConfigAPIController extends OCSController {
* Example: * Example:
* curl -X PUT -d "key=ldapHost&value=ldaps://my.ldap.server" \ * curl -X PUT -d "key=ldapHost&value=ldaps://my.ldap.server" \
* -H "OCS-APIREQUEST: true" -u $admin:$password \ * -H "OCS-APIREQUEST: true" -u $admin:$password \
* https://nextcloud.server/ocs/v1.php/apps/user_ldap/api/v1/config/s60 * https://nextcloud.server/ocs/v2.php/apps/user_ldap/api/v1/config/s60
* *
* <?xml version="1.0"?> * <?xml version="1.0"?>
* <ocs> * <ocs>
@ -186,8 +180,6 @@ class ConfigAPIController extends OCSController {
* <status>ok</status> * <status>ok</status>
* <statuscode>100</statuscode> * <statuscode>100</statuscode>
* <message>OK</message> * <message>OK</message>
* <totalitems></totalitems>
* <itemsperpage></itemsperpage>
* </meta> * </meta>
* <data/> * <data/>
* </ocs> * </ocs>

View File

@ -1,9 +1,11 @@
Feature: LDAP Feature: LDAP
Background:
Given using api version "2"
Scenario: Creating an new, empty configuration Scenario: Creating an new, empty configuration
Given As an "admin" Given As an "admin"
When sending "POST" to "/apps/user_ldap/api/v1/config" When sending "POST" to "/apps/user_ldap/api/v1/config"
Then the OCS status code should be "100" Then the OCS status code should be "200"
And the HTTP status code should be "200" And the HTTP status code should be "200"
And the response should contain a tag "configID" And the response should contain a tag "configID"
@ -11,31 +13,31 @@ Feature: LDAP
Given As an "admin" Given As an "admin"
When sending "DELETE" to "/apps/user_ldap/api/v1/config/s666" When sending "DELETE" to "/apps/user_ldap/api/v1/config/s666"
Then the OCS status code should be "404" Then the OCS status code should be "404"
And the HTTP status code should be "200" And the HTTP status code should be "404"
Scenario: Delete an invalid configuration Scenario: Delete an invalid configuration
Given As an "admin" Given As an "admin"
When sending "DELETE" to "/apps/user_ldap/api/v1/config/hack0r" When sending "DELETE" to "/apps/user_ldap/api/v1/config/hack0r"
Then the OCS status code should be "400" Then the OCS status code should be "400"
And the HTTP status code should be "200" And the HTTP status code should be "400"
Scenario: Create and delete a configuration Scenario: Create and delete a configuration
Given As an "admin" Given As an "admin"
And creating an LDAP configuration at "/apps/user_ldap/api/v1/config" And creating an LDAP configuration at "/apps/user_ldap/api/v1/config"
When deleting the LDAP configuration When deleting the LDAP configuration
Then the OCS status code should be "100" Then the OCS status code should be "200"
And the HTTP status code should be "200" And the HTTP status code should be "200"
Scenario: Create and modify a configuration Scenario: Create and modify a configuration
Given As an "admin" Given As an "admin"
And creating an LDAP configuration at "/apps/user_ldap/api/v1/config" And creating an LDAP configuration at "/apps/user_ldap/api/v1/config"
When setting "ldapHost" of the LDAP configuration to "ldaps://my.ldap.server" When setting "ldapHost" of the LDAP configuration to "ldaps://my.ldap.server"
Then the OCS status code should be "100" Then the OCS status code should be "200"
And the HTTP status code should be "200" And the HTTP status code should be "200"
# Testing an invalid config key # Testing an invalid config key
When setting "crack0r" of the LDAP configuration to "foobar" When setting "crack0r" of the LDAP configuration to "foobar"
Then the OCS status code should be "400" Then the OCS status code should be "400"
And the HTTP status code should be "200" And the HTTP status code should be "400"
Scenario: Modiying a non-existing configuration Scenario: Modiying a non-existing configuration
Given As an "admin" Given As an "admin"
@ -43,4 +45,4 @@ Feature: LDAP
| key | ldapHost | | key | ldapHost |
| value | ldaps://my.ldap.server | | value | ldaps://my.ldap.server |
Then the OCS status code should be "404" Then the OCS status code should be "404"
And the HTTP status code should be "200" And the HTTP status code should be "404"