diff options
author | Florian Pritz <bluewind@xinu.at> | 2016-08-20 15:19:15 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2016-08-20 15:19:15 +0200 |
commit | 3ce4e928c606f2b3a1c393819ca4a1268e3b058b (patch) | |
tree | fbcbadbc18ced14be9bfb3f1b4b553eccda0ae33 /application/test/tests | |
parent | b7853a87ac0575f83793d5d6a7ed44849156e189 (diff) |
tests: Use one webserver per testcase
This allows the tests to run somewhat parallel (still limited by the
database) and simplifies running single testcases without the
./run-tests.sh wrapper.
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/test/tests')
-rw-r--r-- | application/test/tests/test_api_v1.php | 5 | ||||
-rw-r--r-- | application/test/tests/test_api_v2.php | 7 |
2 files changed, 7 insertions, 5 deletions
diff --git a/application/test/tests/test_api_v1.php b/application/test/tests/test_api_v1.php index 0fb709da8..4d50d4796 100644 --- a/application/test/tests/test_api_v1.php +++ b/application/test/tests/test_api_v1.php @@ -19,11 +19,12 @@ class test_api_v1 extends \test\Test { $CI->load->model("muser"); $CI->load->model("mfile"); + $this->startServer(23115); } private function uploadFile($apikey, $file) { - $ret = $this->CallAPI("POST", "$this->server/api/v1.1.0/file/upload", array( + $ret = $this->CallAPI("POST", "$this->server_url/api/v1.1.0/file/upload", array( "apikey" => $apikey, "file[1]" => curl_file_create($file), )); @@ -54,7 +55,7 @@ class test_api_v1 extends \test\Test { private function callEndpoint($verb, $endpoint, $data) { - return $this->CallAPI($verb, "$this->server/api/v1.0.0/$endpoint", $data); + return $this->CallAPI($verb, "$this->server_url/api/v1.0.0/$endpoint", $data); } public function test_callPrivateEndpointsWithoutApikey() diff --git a/application/test/tests/test_api_v2.php b/application/test/tests/test_api_v2.php index c18cd5b8f..b50af4bcf 100644 --- a/application/test/tests/test_api_v2.php +++ b/application/test/tests/test_api_v2.php @@ -19,11 +19,12 @@ class test_api_v2 extends \test\Test { $CI->load->model("muser"); $CI->load->model("mfile"); + $this->startServer(23116); } private function uploadFile($apikey, $file) { - $ret = $this->CallAPI("POST", "$this->server/api/v2.0.0/file/upload", array( + $ret = $this->CallAPI("POST", "$this->server_url/api/v2.0.0/file/upload", array( "apikey" => $apikey, "file[1]" => curl_file_create($file), )); @@ -54,7 +55,7 @@ class test_api_v2 extends \test\Test { private function callEndpoint($verb, $endpoint, $data) { - return $this->CallAPI($verb, "$this->server/api/v2.0.0/$endpoint", $data); + return $this->CallAPI($verb, "$this->server_url/api/v2.0.0/$endpoint", $data); } public function test_callPrivateEndpointsWithoutApikey() @@ -75,7 +76,7 @@ class test_api_v2 extends \test\Test { $this->t->is_deeply(array( 'status' => 'error', 'error_id' => 'api/not-authenticated', - 'message' => 'Not authenticated. FileBin requires you to have an account, please go to the homepage at http://127.0.0.1:23115/ for more information.', + 'message' => 'Not authenticated. FileBin requires you to have an account, please go to the homepage at http://127.0.0.1:23116/ for more information.', ), $ret, "expected error"); } } |