From b27a78e3229af5b477dbc5b31ba2beec7a7238ca Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Tue, 11 Mar 2014 21:19:13 -0400 Subject: Fix unit test --- tests/ActionTaskCloseTest.php | 17 ++++++++++------- 1 file 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']); } } -- cgit v1.2.3