summaryrefslogtreecommitdiff
path: root/tests/units/ActionTest.php
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2014-11-22 10:05:44 -0500
committerFrédéric Guillot <fred@kanboard.net>2014-11-22 10:05:44 -0500
commit15038cdb10f8c691edc7980fd1aed32dcbed3f9f (patch)
treeebdf873e5c65616c3fd36ea2c7a449da52a61877 /tests/units/ActionTest.php
parent8f0e544cd91b24423951bbb5d3f3be0950a63abe (diff)
Move task creation to a seperate class
Diffstat (limited to 'tests/units/ActionTest.php')
-rw-r--r--tests/units/ActionTest.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/tests/units/ActionTest.php b/tests/units/ActionTest.php
index dd8e11fe..1115e4fc 100644
--- a/tests/units/ActionTest.php
+++ b/tests/units/ActionTest.php
@@ -6,6 +6,7 @@ use Model\Action;
use Model\Project;
use Model\Board;
use Model\Task;
+use Model\TaskCreation;
use Model\TaskFinder;
use Model\Category;
@@ -49,7 +50,8 @@ class ActionTest extends Base
public function testEventMoveColumn()
{
- $task = new Task($this->container);
+ $t = new Task($this->container);
+ $tc = new TaskCreation($this->container);
$tf = new TaskFinder($this->container);
$board = new Board($this->container);
$project = new Project($this->container);
@@ -59,7 +61,7 @@ class ActionTest extends Base
$this->assertEquals(1, $project->create(array('name' => 'unit_test')));
// We create a task
- $this->assertEquals(1, $task->create(array(
+ $this->assertEquals(1, $tc->create(array(
'title' => 'unit_test',
'project_id' => 1,
'owner_id' => 1,
@@ -86,7 +88,7 @@ class ActionTest extends Base
$this->assertEquals(1, $t1['column_id']);
// We move our task
- $task->movePosition(1, 1, 4, 1);
+ $t->movePosition(1, 1, 4, 1);
$this->assertTrue($this->container['event']->isEventTriggered(Task::EVENT_MOVE_COLUMN));
$this->assertFalse($this->container['event']->isEventTriggered(Task::EVENT_UPDATE));
@@ -99,7 +101,8 @@ class ActionTest extends Base
public function testExecuteMultipleActions()
{
- $task = new Task($this->container);
+ $t = new Task($this->container);
+ $tc = new TaskCreation($this->container);
$tf = new TaskFinder($this->container);
$board = new Board($this->container);
$project = new Project($this->container);
@@ -110,7 +113,7 @@ class ActionTest extends Base
$this->assertEquals(2, $project->create(array('name' => 'unit_test2')));
// We create a task
- $this->assertEquals(1, $task->create(array(
+ $this->assertEquals(1, $tc->create(array(
'title' => 'unit_test',
'project_id' => 1,
'owner_id' => 1,
@@ -152,7 +155,7 @@ class ActionTest extends Base
$this->assertEquals(1, $t1['project_id']);
// We move our task
- $task->movePosition(1, 1, 4, 1);
+ $t->movePosition(1, 1, 4, 1);
$this->assertTrue($this->container['event']->isEventTriggered(Task::EVENT_CLOSE));
$this->assertTrue($this->container['event']->isEventTriggered(Task::EVENT_MOVE_COLUMN));