summaryrefslogtreecommitdiffstats
path: root/application/test/tests/test_api_v1.php
diff options
context:
space:
mode:
Diffstat (limited to 'application/test/tests/test_api_v1.php')
-rw-r--r--application/test/tests/test_api_v1.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/application/test/tests/test_api_v1.php b/application/test/tests/test_api_v1.php
index bc311f8e5..f0a2096d6 100644
--- a/application/test/tests/test_api_v1.php
+++ b/application/test/tests/test_api_v1.php
@@ -298,6 +298,28 @@ class test_api_v1 extends \test\Test {
$this->t->is($ret["data"]["total_size"], $expected_filesize, "total_size == uploaded files");
}
+ public function test_history_notEmptyAfterMultipaste()
+ {
+ $apikey = $this->createUserAndApikey();
+ $uploadid = $this->uploadFile($apikey, "data/tests/small-file")['data']['ids'][0];
+ $multipasteid = $this->CallEndpoint("POST", "file/create_multipaste", array(
+ "apikey" => $apikey,
+ 'ids[1]' => $uploadid,
+ ))['data']['url_id'];
+
+ $ret = $this->CallEndpoint("POST", "file/history", array(
+ "apikey" => $apikey,
+ ));
+ $this->expectSuccess("history not empty after multipaste", $ret);
+
+ $this->t->ok(!empty($ret["data"]["items"]), "history not empty after multipaste (items)");
+ $this->t->is($ret['data']["multipaste_items"][$multipasteid]['items'][$uploadid]['id'], $uploadid, "multipaste contains correct id");
+ $this->t->is_deeply(array(
+ 'url_id', 'multipaste_id', 'user_id', 'date', 'items'
+ ), array_keys($ret['data']["multipaste_items"][$multipasteid]), "multipaste info only lists correct keys");
+ $this->t->is_deeply(array('id'), array_keys($ret['data']["multipaste_items"][$multipasteid]['items'][$uploadid]), "multipaste item info only lists correct keys");
+ }
+
public function test_history_notEmptyAfterUpload()
{
$apikey = $this->createUserAndApikey();