From a823cc1d08535539f850711c0b9edb5b648f1960 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 23 Jul 2016 14:50:59 -0400 Subject: NotificationModel refactoring --- tests/units/EventBuilder/CommentEventBuilderTest.php | 4 ++-- tests/units/EventBuilder/ProjectFileEventBuilderTest.php | 4 ++-- tests/units/EventBuilder/SubtaskEventBuilderTest.php | 6 +++--- tests/units/EventBuilder/TaskEventBuilderTest.php | 10 +++++----- tests/units/EventBuilder/TaskFileEventBuilderTest.php | 4 ++-- tests/units/EventBuilder/TaskLinkEventBuilderTest.php | 6 +++--- 6 files changed, 17 insertions(+), 17 deletions(-) (limited to 'tests/units/EventBuilder') diff --git a/tests/units/EventBuilder/CommentEventBuilderTest.php b/tests/units/EventBuilder/CommentEventBuilderTest.php index a490799e..2f6a90b5 100644 --- a/tests/units/EventBuilder/CommentEventBuilderTest.php +++ b/tests/units/EventBuilder/CommentEventBuilderTest.php @@ -13,7 +13,7 @@ class CommentEventBuilderTest extends Base { $commentEventBuilder = new CommentEventBuilder($this->container); $commentEventBuilder->withCommentId(42); - $this->assertNull($commentEventBuilder->build()); + $this->assertNull($commentEventBuilder->buildEvent()); } public function testBuild() @@ -28,7 +28,7 @@ class CommentEventBuilderTest extends Base $this->assertEquals(1, $commentModel->create(array('task_id' => 1, 'comment' => 'bla bla', 'user_id' => 1))); $commentEventBuilder->withCommentId(1); - $event = $commentEventBuilder->build(); + $event = $commentEventBuilder->buildEvent(); $this->assertInstanceOf('Kanboard\Event\CommentEvent', $event); $this->assertNotEmpty($event['comment']); diff --git a/tests/units/EventBuilder/ProjectFileEventBuilderTest.php b/tests/units/EventBuilder/ProjectFileEventBuilderTest.php index bfe22719..8f5eb87e 100644 --- a/tests/units/EventBuilder/ProjectFileEventBuilderTest.php +++ b/tests/units/EventBuilder/ProjectFileEventBuilderTest.php @@ -12,7 +12,7 @@ class ProjectFileEventBuilderTest extends Base { $projectFileEventBuilder = new ProjectFileEventBuilder($this->container); $projectFileEventBuilder->withFileId(42); - $this->assertNull($projectFileEventBuilder->build()); + $this->assertNull($projectFileEventBuilder->buildEvent()); } public function testBuild() @@ -24,7 +24,7 @@ class ProjectFileEventBuilderTest extends Base $this->assertEquals(1, $projectModel->create(array('name' => 'test1'))); $this->assertEquals(1, $projectFileModel->create(1, 'Test', '/tmp/test', 123)); - $event = $projectFileEventBuilder->withFileId(1)->build(); + $event = $projectFileEventBuilder->withFileId(1)->buildEvent(); $this->assertInstanceOf('Kanboard\Event\ProjectFileEvent', $event); $this->assertNotEmpty($event['file']); diff --git a/tests/units/EventBuilder/SubtaskEventBuilderTest.php b/tests/units/EventBuilder/SubtaskEventBuilderTest.php index 062bdfb4..fe425cb8 100644 --- a/tests/units/EventBuilder/SubtaskEventBuilderTest.php +++ b/tests/units/EventBuilder/SubtaskEventBuilderTest.php @@ -13,7 +13,7 @@ class SubtaskEventBuilderTest extends Base { $subtaskEventBuilder = new SubtaskEventBuilder($this->container); $subtaskEventBuilder->withSubtaskId(42); - $this->assertNull($subtaskEventBuilder->build()); + $this->assertNull($subtaskEventBuilder->buildEvent()); } public function testBuildWithoutChanges() @@ -27,7 +27,7 @@ class SubtaskEventBuilderTest extends Base $this->assertEquals(1, $taskCreationModel->create(array('title' => 'test', 'project_id' => 1))); $this->assertEquals(1, $subtaskModel->create(array('task_id' => 1, 'title' => 'test'))); - $event = $subtaskEventBuilder->withSubtaskId(1)->build(); + $event = $subtaskEventBuilder->withSubtaskId(1)->buildEvent(); $this->assertInstanceOf('Kanboard\Event\SubtaskEvent', $event); $this->assertNotEmpty($event['subtask']); @@ -49,7 +49,7 @@ class SubtaskEventBuilderTest extends Base $event = $subtaskEventBuilder ->withSubtaskId(1) ->withValues(array('title' => 'new title', 'user_id' => 1)) - ->build(); + ->buildEvent(); $this->assertInstanceOf('Kanboard\Event\SubtaskEvent', $event); $this->assertNotEmpty($event['subtask']); diff --git a/tests/units/EventBuilder/TaskEventBuilderTest.php b/tests/units/EventBuilder/TaskEventBuilderTest.php index e6334fe2..c89dcd85 100644 --- a/tests/units/EventBuilder/TaskEventBuilderTest.php +++ b/tests/units/EventBuilder/TaskEventBuilderTest.php @@ -12,7 +12,7 @@ class TaskEventBuilderTest extends Base { $taskEventBuilder = new TaskEventBuilder($this->container); $taskEventBuilder->withTaskId(42); - $this->assertNull($taskEventBuilder->build()); + $this->assertNull($taskEventBuilder->buildEvent()); } public function testBuildWithTask() @@ -28,7 +28,7 @@ class TaskEventBuilderTest extends Base ->withTaskId(1) ->withTask(array('title' => 'before')) ->withChanges(array('title' => 'after')) - ->build(); + ->buildEvent(); $this->assertInstanceOf('Kanboard\Event\TaskEvent', $event); $this->assertNotEmpty($event['task']); @@ -45,7 +45,7 @@ class TaskEventBuilderTest extends Base $this->assertEquals(1, $projectModel->create(array('name' => 'test1'))); $this->assertEquals(1, $taskCreationModel->create(array('title' => 'test', 'project_id' => 1))); - $event = $taskEventBuilder->withTaskId(1)->build(); + $event = $taskEventBuilder->withTaskId(1)->buildEvent(); $this->assertInstanceOf('Kanboard\Event\TaskEvent', $event); $this->assertNotEmpty($event['task']); @@ -65,7 +65,7 @@ class TaskEventBuilderTest extends Base $event = $taskEventBuilder ->withTaskId(1) ->withChanges(array('title' => 'new title')) - ->build(); + ->buildEvent(); $this->assertInstanceOf('Kanboard\Event\TaskEvent', $event); $this->assertNotEmpty($event['task']); @@ -86,7 +86,7 @@ class TaskEventBuilderTest extends Base ->withTaskId(1) ->withChanges(array('title' => 'new title', 'project_id' => 1)) ->withValues(array('key' => 'value')) - ->build(); + ->buildEvent(); $this->assertInstanceOf('Kanboard\Event\TaskEvent', $event); $this->assertNotEmpty($event['task']); diff --git a/tests/units/EventBuilder/TaskFileEventBuilderTest.php b/tests/units/EventBuilder/TaskFileEventBuilderTest.php index c253b913..c90e18d3 100644 --- a/tests/units/EventBuilder/TaskFileEventBuilderTest.php +++ b/tests/units/EventBuilder/TaskFileEventBuilderTest.php @@ -13,7 +13,7 @@ class TaskFileEventBuilderTest extends Base { $taskFileEventBuilder = new TaskFileEventBuilder($this->container); $taskFileEventBuilder->withFileId(42); - $this->assertNull($taskFileEventBuilder->build()); + $this->assertNull($taskFileEventBuilder->buildEvent()); } public function testBuild() @@ -27,7 +27,7 @@ class TaskFileEventBuilderTest extends Base $this->assertEquals(1, $taskCreationModel->create(array('title' => 'test', 'project_id' => 1))); $this->assertEquals(1, $taskFileModel->create(1, 'Test', '/tmp/test', 123)); - $event = $taskFileEventBuilder->withFileId(1)->build(); + $event = $taskFileEventBuilder->withFileId(1)->buildEvent(); $this->assertInstanceOf('Kanboard\Event\TaskFileEvent', $event); $this->assertNotEmpty($event['file']); diff --git a/tests/units/EventBuilder/TaskLinkEventBuilderTest.php b/tests/units/EventBuilder/TaskLinkEventBuilderTest.php index 7364d651..18508146 100644 --- a/tests/units/EventBuilder/TaskLinkEventBuilderTest.php +++ b/tests/units/EventBuilder/TaskLinkEventBuilderTest.php @@ -13,7 +13,7 @@ class TaskLinkEventBuilderTest extends Base { $taskLinkEventBuilder = new TaskLinkEventBuilder($this->container); $taskLinkEventBuilder->withTaskLinkId(42); - $this->assertNull($taskLinkEventBuilder->build()); + $this->assertNull($taskLinkEventBuilder->buildEvent()); } public function testBuild() @@ -28,7 +28,7 @@ class TaskLinkEventBuilderTest extends Base $this->assertEquals(2, $taskCreationModel->create(array('title' => 'task 2', 'project_id' => 1))); $this->assertEquals(1, $taskLinkModel->create(1, 2, 1)); - $event = $taskLinkEventBuilder->withTaskLinkId(1)->build(); + $event = $taskLinkEventBuilder->withTaskLinkId(1)->buildEvent(); $this->assertInstanceOf('Kanboard\Event\TaskLinkEvent', $event); $this->assertNotEmpty($event['task_link']); @@ -47,7 +47,7 @@ class TaskLinkEventBuilderTest extends Base $this->assertEquals(2, $taskCreationModel->create(array('title' => 'task 2', 'project_id' => 1))); $this->assertEquals(1, $taskLinkModel->create(1, 2, 1)); - $eventData = $taskLinkEventBuilder->withTaskLinkId(1)->build(); + $eventData = $taskLinkEventBuilder->withTaskLinkId(1)->buildEvent(); $title = $taskLinkEventBuilder->buildTitleWithAuthor('Foobar', TaskLinkModel::EVENT_CREATE_UPDATE, $eventData->getAll()); $this->assertEquals('Foobar set a new internal link for the task #1', $title); -- cgit v1.2.3