summaryrefslogtreecommitdiff
path: root/tests/integration/TaskFileTest.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-06-26 10:25:13 -0400
committerFrederic Guillot <fred@kanboard.net>2016-06-26 10:25:13 -0400
commit4a230d331ec220fc32a48525afb308af0d9787fa (patch)
tree514aa3d703155b7f97a2c77147c9fd74cef60f84 /tests/integration/TaskFileTest.php
parent922e0fb6de06a98774418612e0b0f75af72b6dbb (diff)
Added application and project roles validation for API procedure calls
Diffstat (limited to 'tests/integration/TaskFileTest.php')
-rw-r--r--tests/integration/TaskFileTest.php67
1 files changed, 0 insertions, 67 deletions
diff --git a/tests/integration/TaskFileTest.php b/tests/integration/TaskFileTest.php
deleted file mode 100644
index 7e9e943b..00000000
--- a/tests/integration/TaskFileTest.php
+++ /dev/null
@@ -1,67 +0,0 @@
-<?php
-
-require_once __DIR__.'/BaseIntegrationTest.php';
-
-class TaskFileTest extends BaseIntegrationTest
-{
- protected $projectName = 'My project to test task files';
- protected $fileId;
-
- public function testAll()
- {
- $this->assertCreateTeamProject();
- $this->assertCreateTask();
- $this->assertCreateTaskFile();
- $this->assertGetTaskFile();
- $this->assertDownloadTaskFile();
- $this->assertGetAllFiles();
- $this->assertRemoveTaskFile();
- $this->assertRemoveAllTaskFiles();
- }
-
- public function assertCreateTaskFile()
- {
- $this->fileId = $this->app->createTaskFile(1, $this->taskId, 'My file', base64_encode('plain text file'));
- $this->assertNotFalse($this->fileId);
- }
-
- public function assertGetTaskFile()
- {
- $file = $this->app->getTaskFile($this->fileId);
- $this->assertNotEmpty($file);
- $this->assertEquals('My file', $file['name']);
- }
-
- public function assertDownloadTaskFile()
- {
- $content = $this->app->downloadTaskFile($this->fileId);
- $this->assertNotEmpty($content);
- $this->assertEquals('plain text file', base64_decode($content));
- }
-
- public function assertGetAllFiles()
- {
- $files = $this->app->getAllTaskFiles(array('task_id' => $this->taskId));
- $this->assertCount(1, $files);
- $this->assertEquals('My file', $files[0]['name']);
- }
-
- public function assertRemoveTaskFile()
- {
- $this->assertTrue($this->app->removeTaskFile($this->fileId));
-
- $files = $this->app->getAllTaskFiles(array('task_id' => $this->taskId));
- $this->assertEmpty($files);
- }
-
- public function assertRemoveAllTaskFiles()
- {
- $this->assertCreateTaskFile();
- $this->assertCreateTaskFile();
-
- $this->assertTrue($this->app->removeAllTaskFiles($this->taskId));
-
- $files = $this->app->getAllTaskFiles(array('task_id' => $this->taskId));
- $this->assertEmpty($files);
- }
-}