diff options
author | Florian Pritz <bluewind@xinu.at> | 2016-10-08 16:57:44 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2016-11-05 19:44:15 +0100 |
commit | 2c94026f7f36ec7da94279a94ecf1f555f3994c6 (patch) | |
tree | 7feba2745d875db154b1837008526aa3c39c9353 /application/test/tests/api_v2/test_misc.php | |
parent | 83f45f1fdf9cf89a0f3dac99221cc6e770e94dc0 (diff) |
Parallelize remaining API tests
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/test/tests/api_v2/test_misc.php')
-rw-r--r-- | application/test/tests/api_v2/test_misc.php | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/application/test/tests/api_v2/test_misc.php b/application/test/tests/api_v2/test_misc.php new file mode 100644 index 000000000..e7c249054 --- /dev/null +++ b/application/test/tests/api_v2/test_misc.php @@ -0,0 +1,48 @@ +<?php +/* + * Copyright 2016 Florian "Bluewind" Pritz <bluewind@server-speed.net> + * + * Licensed under AGPLv3 + * (see COPYING for full license text) + * + */ + +namespace test\tests\api_v2; + +class test_misc extends common { + + public function __construct() + { + parent::__construct(); + $this->startServer(23207); + $this->userCounter = 7100; + } + + public function test_apikeys_getApikey() + { + $userid = $this->createUser(2); + $apikey = $this->createApikey($userid); + $apikey_full = $this->createApikey($userid, "full"); + $ret = $this->CallEndpoint("POST", "user/apikeys", array( + "apikey" => $apikey_full, + )); + $this->expectSuccess("get apikeys", $ret); + + $this->t->is($ret["data"]["apikeys"][$apikey]["key"], $apikey, "expected key 1"); + $this->t->is($ret["data"]["apikeys"][$apikey]["access_level"], "apikey", "expected key 1 acces_level"); + $this->t->is($ret["data"]["apikeys"][$apikey]["comment"], "", "expected key 1 comment"); + $this->t->ok(is_int($ret["data"]["apikeys"][$apikey]["created"]) , "expected key 1 creation time is int"); + } + + public function test_get_config() + { + $ret = $this->CallEndpoint("GET", "file/get_config", array( + )); + $this->expectSuccess("get_config", $ret); + + $this->t->like($ret["data"]["upload_max_size"], '/[0-9]+/', "upload_max_size is int"); + $this->t->like($ret["data"]["max_files_per_request"], '/[0-9]+/', "max_files_per_request is int"); + } + + +} |