summaryrefslogtreecommitdiff
path: root/tests/integration/CommentTest.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/CommentTest.php
parent922e0fb6de06a98774418612e0b0f75af72b6dbb (diff)
Added application and project roles validation for API procedure calls
Diffstat (limited to 'tests/integration/CommentTest.php')
-rw-r--r--tests/integration/CommentTest.php63
1 files changed, 0 insertions, 63 deletions
diff --git a/tests/integration/CommentTest.php b/tests/integration/CommentTest.php
deleted file mode 100644
index 34376838..00000000
--- a/tests/integration/CommentTest.php
+++ /dev/null
@@ -1,63 +0,0 @@
-<?php
-
-require_once __DIR__.'/BaseIntegrationTest.php';
-
-class CommentTest extends BaseIntegrationTest
-{
- protected $projectName = 'My project to test comments';
- private $commentId = 0;
-
- public function testAll()
- {
- $this->assertCreateTeamProject();
- $this->assertCreateTask();
- $this->assertCreateComment();
- $this->assertUpdateComment();
- $this->assertGetAllComments();
- $this->assertRemoveComment();
- }
-
- public function assertCreateComment()
- {
- $this->commentId = $this->app->execute('createComment', array(
- 'task_id' => $this->taskId,
- 'user_id' => 1,
- 'content' => 'foobar',
- ));
-
- $this->assertNotFalse($this->commentId);
- }
-
- public function assertGetComment()
- {
- $comment = $this->app->getComment($this->commentId);
- $this->assertNotFalse($comment);
- $this->assertNotEmpty($comment);
- $this->assertEquals(1, $comment['user_id']);
- $this->assertEquals('foobar', $comment['comment']);
- }
-
- public function assertUpdateComment()
- {
- $this->assertTrue($this->app->execute('updateComment', array(
- 'id' => $this->commentId,
- 'content' => 'test',
- )));
-
- $comment = $this->app->getComment($this->commentId);
- $this->assertEquals('test', $comment['comment']);
- }
-
- public function assertGetAllComments()
- {
- $comments = $this->app->getAllComments($this->taskId);
- $this->assertCount(1, $comments);
- $this->assertEquals('test', $comments[0]['comment']);
- }
-
- public function assertRemoveComment()
- {
- $this->assertTrue($this->app->removeComment($this->commentId));
- $this->assertFalse($this->app->removeComment($this->commentId));
- }
-}