diff options
author | Frédéric Guillot <fguillot@users.noreply.github.com> | 2014-03-11 21:19:13 -0400 |
---|---|---|
committer | Frédéric Guillot <fguillot@users.noreply.github.com> | 2014-03-11 21:19:13 -0400 |
commit | b27a78e3229af5b477dbc5b31ba2beec7a7238ca (patch) | |
tree | bfd4916df41f3b83f98b95036cfc7c559b715fe7 | |
parent | c0ab45110688d698c1038d203017fda2385c5142 (diff) |
Fix unit test
-rw-r--r-- | tests/ActionTaskCloseTest.php | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/tests/ActionTaskCloseTest.php b/tests/ActionTaskCloseTest.php index 0d405739..662c5d44 100644 --- a/tests/ActionTaskCloseTest.php +++ b/tests/ActionTaskCloseTest.php @@ -3,6 +3,7 @@ require_once __DIR__.'/base.php'; use Model\Task; +use Model\Project; class ActionTaskCloseTest extends Base { @@ -17,7 +18,8 @@ class ActionTaskCloseTest extends Base 'column_id' => 5, ); - $this->assertFalse($action->doAction($event)); + $this->assertFalse($action->isExecutable($event)); + $this->assertFalse($action->execute($event)); } public function testBadColumn() @@ -31,7 +33,7 @@ class ActionTaskCloseTest extends Base 'column_id' => 3, ); - $this->assertFalse($action->doAction($event)); + $this->assertFalse($action->execute($event)); } public function testExecute() @@ -40,7 +42,8 @@ class ActionTaskCloseTest extends Base $action->setParam('column_id', 2); // We create a task in the first column - $task = new Task($this->db, $this->event); + $t = new Task($this->db, $this->event); + $p = new Project($this->db, $this->event); $this->assertEquals(1, $p->create(array('name' => 'test'))); $this->assertEquals(1, $t->create(array('title' => 'test', 'project_id' => 1, 'column_id' => 1))); @@ -52,11 +55,11 @@ class ActionTaskCloseTest extends Base ); // Our event should be executed - $this->assertTrue($action->doAction($event)); + $this->assertTrue($action->execute($event)); // Our task should be closed - $t = $task->getById(1); - $this->assertNotEmpty($t); - $this->assertEquals(0, $t['is_active']); + $task = $t->getById(1); + $this->assertNotEmpty($task); + $this->assertEquals(0, $task['is_active']); } } |