summaryrefslogtreecommitdiff
path: root/tests/functionals/ApiTest.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-06-13 15:47:48 -0400
committerFrederic Guillot <fred@kanboard.net>2015-06-13 15:47:48 -0400
commit0b7435b8827081341a331ecdd5546ac25121d87d (patch)
treee439735e077ceb0b4f77266b1f3e9fcd337e55e8 /tests/functionals/ApiTest.php
parent41610150238a67471d79caa5bcb2ace1dd4578d1 (diff)
API: new procedure 'removeAllFiles' and contract change for 'createFile'
Diffstat (limited to 'tests/functionals/ApiTest.php')
-rw-r--r--tests/functionals/ApiTest.php17
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/functionals/ApiTest.php b/tests/functionals/ApiTest.php
index b5039759..ab64b6d0 100644
--- a/tests/functionals/ApiTest.php
+++ b/tests/functionals/ApiTest.php
@@ -937,7 +937,7 @@ class Api extends PHPUnit_Framework_TestCase
public function testCreateFile()
{
- $this->assertTrue($this->client->createFile(1, 1, 'My file', false, base64_encode('plain text file')));
+ $this->assertEquals(1, $this->client->createFile(1, 1, 'My file', base64_encode('plain text file')));
}
public function testGetAllFiles()
@@ -962,4 +962,19 @@ class Api extends PHPUnit_Framework_TestCase
$this->assertTrue($this->client->removeFile($file['id']));
$this->assertEmpty($this->client->getAllFiles(1));
}
+
+ public function testRemoveAllFiles()
+ {
+ $this->assertEquals(1, $this->client->createFile(1, 1, 'My file 1', base64_encode('plain text file')));
+ $this->assertEquals(2, $this->client->createFile(1, 1, 'My file 2', base64_encode('plain text file')));
+
+ $files = $this->client->getAllFiles(array('task_id' => 1));
+ $this->assertNotEmpty($files);
+ $this->assertCount(2, $files);
+
+ $this->assertTrue($this->client->removeAllFiles(array('task_id' => 1)));
+
+ $files = $this->client->getAllFiles(array('task_id' => 1));
+ $this->assertEmpty($files);
+ }
} \ No newline at end of file