summaryrefslogtreecommitdiffstats
path: root/application/tests/test_api_v1.php
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2015-05-17 23:32:28 +0200
committerFlorian Pritz <bluewind@xinu.at>2015-05-21 18:43:13 +0200
commita3210275b113663cd4f2133ed81bae308f63dff2 (patch)
tree35606b08d493cc08751f6ff021026057471c0e6b /application/tests/test_api_v1.php
parent1172f71ca8cc22384ab4bf7242c7645d88e0f6c8 (diff)
test: different files with same checksum
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/tests/test_api_v1.php')
-rw-r--r--application/tests/test_api_v1.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/application/tests/test_api_v1.php b/application/tests/test_api_v1.php
index b39d5d44c..378f741de 100644
--- a/application/tests/test_api_v1.php
+++ b/application/tests/test_api_v1.php
@@ -245,6 +245,25 @@ class test_api_v1 extends Test {
$this->t->ok(!empty($ret["data"]["urls"]), "got URLs");
}
+ public function test_upload_uploadFileSameMD5()
+ {
+ $apikey = $this->createUserAndApikey();
+ $ret = $this->CallEndpoint("POST", "file/upload", array(
+ "apikey" => $apikey,
+ "file[1]" => curl_file_create("data/tests/message1.bin"),
+ "file[2]" => curl_file_create("data/tests/message2.bin"),
+ ));
+ $this->expectSuccess("upload file", $ret);
+
+ $this->t->ok(!empty($ret["data"]["ids"]), "got IDs");
+ $this->t->ok(!empty($ret["data"]["urls"]), "got URLs");
+
+ foreach ($ret["data"]["urls"] as $url) {
+ $data[] = $this->SendHTTPRequest("GET", $url, '');
+ }
+ $this->t->ok($data[0] !== $data[1], 'Returned file contents should differ');
+ }
+
public function test_upload_uploadNothing()
{
$apikey = $this->createUserAndApikey();