diff options
author | Olivier Paroz <github@oparoz.com> | 2015-08-11 03:34:03 +0300 |
---|---|---|
committer | Olivier Paroz <github@oparoz.com> | 2015-08-11 03:34:03 +0300 |
commit | b84508a0b687b91b623c6f81ea99e5fe40daa846 (patch) | |
tree | fdc2ffb7294a715d6f0a20d35fc135030d905aa6 /tests/api | |
parent | a8b1af48860f359435fa451fa9c765c420b3dd33 (diff) |
1st acceptance and api tests
Diffstat (limited to 'tests/api')
-rw-r--r-- | tests/api/CreateUserCept.php | 24 | ||||
-rw-r--r-- | tests/api/_bootstrap.php | 2 |
2 files changed, 26 insertions, 0 deletions
diff --git a/tests/api/CreateUserCept.php b/tests/api/CreateUserCept.php new file mode 100644 index 00000000..8f0f5a09 --- /dev/null +++ b/tests/api/CreateUserCept.php @@ -0,0 +1,24 @@ +<?php +use Codeception\Util\Xml as XmlUtils; + +$I = new ApiTester($scenario); +$I->wantTo('create a user via the provisioning API'); +$baseUrl = '/ocs/v1.php/cloud'; +$I->amHttpAuthenticated('admin', 'admin'); +$I->haveHttpHeader('Content-Type', 'application/x-www-form-urlencoded'); +$I->sendPOST($baseUrl . '/users', ['userid' => 'test', 'password' => 'test']); +$I->seeResponseCodeIs(200); +$I->seeResponseIsXml(); +$I->seeXmlResponseIncludes( + XmlUtils::toXml( + ['status' => 'ok'] +)); + +// Make sure the user exists +$I->sendGET($baseUrl . '/users/test'); +$I->seeResponseCodeIs(200); +$I->seeResponseIsXml(); +$I->seeXmlResponseIncludes( + XmlUtils::toXml( + ['status' => 'ok'] +)); diff --git a/tests/api/_bootstrap.php b/tests/api/_bootstrap.php new file mode 100644 index 00000000..8a885558 --- /dev/null +++ b/tests/api/_bootstrap.php @@ -0,0 +1,2 @@ +<?php +// Here you can initialize variables that will be available to your tests |