diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-07-20 21:47:23 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-07-20 21:47:23 -0400 |
commit | 3dd20c9c78e61028a4c7db232c7b2b30662a2987 (patch) | |
tree | 74f07dac8b8a41d2834e38f239f5527d5f455650 | |
parent | 7b100cc57b58a1ef5c2c6cef28904e1ba79f0c49 (diff) |
Rename CommentModel::EVENT_REMOVE to CommentModel::EVENT_DELETE
-rw-r--r-- | app/Model/CommentModel.php | 4 | ||||
-rw-r--r-- | app/Model/NotificationModel.php | 6 | ||||
-rw-r--r-- | app/Subscriber/NotificationSubscriber.php | 2 | ||||
-rw-r--r-- | app/Template/event/comment_delete.php (renamed from app/Template/event/comment_remove.php) | 0 | ||||
-rw-r--r-- | app/Template/notification/comment_delete.php (renamed from app/Template/notification/comment_remove.php) | 0 | ||||
-rw-r--r-- | tests/units/Job/CommentEventJobTest.php | 4 |
6 files changed, 8 insertions, 8 deletions
diff --git a/app/Model/CommentModel.php b/app/Model/CommentModel.php index 6b983858..a9e48bd3 100644 --- a/app/Model/CommentModel.php +++ b/app/Model/CommentModel.php @@ -26,7 +26,7 @@ class CommentModel extends Base */ const EVENT_UPDATE = 'comment.update'; const EVENT_CREATE = 'comment.create'; - const EVENT_REMOVE = 'comment.remove'; + const EVENT_DELETE = 'comment.delete'; const EVENT_USER_MENTION = 'comment.user.mention'; /** @@ -166,7 +166,7 @@ class CommentModel extends Base */ public function remove($comment_id) { - $this->commentEventJob->execute($comment_id, self::EVENT_REMOVE); + $this->commentEventJob->execute($comment_id, self::EVENT_DELETE); return $this->db->table(self::TABLE)->eq('id', $comment_id)->remove(); } } diff --git a/app/Model/NotificationModel.php b/app/Model/NotificationModel.php index ac8d9bae..925d646e 100644 --- a/app/Model/NotificationModel.php +++ b/app/Model/NotificationModel.php @@ -76,7 +76,7 @@ class NotificationModel extends Base return e('%s updated a comment on the task #%d', $event_author, $event_data['task']['id']); case CommentModel::EVENT_CREATE: return e('%s commented on the task #%d', $event_author, $event_data['task']['id']); - case CommentModel::EVENT_REMOVE: + case CommentModel::EVENT_DELETE: return e('%s removed a comment on the task #%d', $event_author, $event_data['task']['id']); case TaskFileModel::EVENT_CREATE: return e('%s attached a file to the task #%d', $event_author, $event_data['task']['id']); @@ -106,7 +106,7 @@ class NotificationModel extends Base return e('New comment on task #%d', $event_data['comment']['task_id']); case CommentModel::EVENT_UPDATE: return e('Comment updated on task #%d', $event_data['comment']['task_id']); - case CommentModel::EVENT_REMOVE: + case CommentModel::EVENT_DELETE: return e('Comment removed on task #%d', $event_data['comment']['task_id']); case SubtaskModel::EVENT_CREATE: return e('New subtask on task #%d', $event_data['subtask']['task_id']); @@ -157,7 +157,7 @@ class NotificationModel extends Base return $event_data['file']['task_id']; case CommentModel::EVENT_CREATE: case CommentModel::EVENT_UPDATE: - case CommentModel::EVENT_REMOVE: + case CommentModel::EVENT_DELETE: return $event_data['comment']['task_id']; case SubtaskModel::EVENT_CREATE: case SubtaskModel::EVENT_UPDATE: diff --git a/app/Subscriber/NotificationSubscriber.php b/app/Subscriber/NotificationSubscriber.php index 104927a0..7de24e49 100644 --- a/app/Subscriber/NotificationSubscriber.php +++ b/app/Subscriber/NotificationSubscriber.php @@ -28,7 +28,7 @@ class NotificationSubscriber extends BaseSubscriber implements EventSubscriberIn SubtaskModel::EVENT_DELETE => 'handleEvent', CommentModel::EVENT_CREATE => 'handleEvent', CommentModel::EVENT_UPDATE => 'handleEvent', - CommentModel::EVENT_REMOVE => 'handleEvent', + CommentModel::EVENT_DELETE => 'handleEvent', CommentModel::EVENT_USER_MENTION => 'handleEvent', TaskFileModel::EVENT_CREATE => 'handleEvent', ); diff --git a/app/Template/event/comment_remove.php b/app/Template/event/comment_delete.php index ead7d56a..ead7d56a 100644 --- a/app/Template/event/comment_remove.php +++ b/app/Template/event/comment_delete.php diff --git a/app/Template/notification/comment_remove.php b/app/Template/notification/comment_delete.php index 928623ec..928623ec 100644 --- a/app/Template/notification/comment_remove.php +++ b/app/Template/notification/comment_delete.php diff --git a/tests/units/Job/CommentEventJobTest.php b/tests/units/Job/CommentEventJobTest.php index 88742feb..8571af8e 100644 --- a/tests/units/Job/CommentEventJobTest.php +++ b/tests/units/Job/CommentEventJobTest.php @@ -32,7 +32,7 @@ class CommentEventJobTest extends Base { $this->container['dispatcher']->addListener(CommentModel::EVENT_CREATE, function() {}); $this->container['dispatcher']->addListener(CommentModel::EVENT_UPDATE, function() {}); - $this->container['dispatcher']->addListener(CommentModel::EVENT_REMOVE, function() {}); + $this->container['dispatcher']->addListener(CommentModel::EVENT_DELETE, function() {}); $commentModel = new CommentModel($this->container); $taskCreationModel = new TaskCreationModel($this->container); @@ -47,6 +47,6 @@ class CommentEventJobTest extends Base $called = $this->container['dispatcher']->getCalledListeners(); $this->assertArrayHasKey(CommentModel::EVENT_CREATE.'.closure', $called); $this->assertArrayHasKey(CommentModel::EVENT_UPDATE.'.closure', $called); - $this->assertArrayHasKey(CommentModel::EVENT_REMOVE.'.closure', $called); + $this->assertArrayHasKey(CommentModel::EVENT_DELETE.'.closure', $called); } } |