Create TaskModification model

This commit is contained in:
Frédéric Guillot
2014-11-23 15:55:59 -05:00
parent 35e4c1daaa
commit f684602ebe
18 changed files with 326 additions and 123 deletions

View File

@@ -146,27 +146,4 @@ class TaskTest extends Base
$this->assertNotEmpty($task);
$this->assertEquals(0, $task['owner_id']);
}
public function testEvents()
{
$t = new Task($this->container);
$tc = new TaskCreation($this->container);
$ts = new TaskStatus($this->container);
$p = new Project($this->container);
// We create a project
$this->assertEquals(1, $p->create(array('name' => 'test')));
// We create task
$this->assertEquals(1, $tc->create(array('title' => 'test', 'project_id' => 1, 'column_id' => 1)));
// We update a task
$this->assertTrue($t->update(array('title' => 'test2', 'id' => 1)));
$this->assertTrue($this->container['event']->isEventTriggered(Task::EVENT_UPDATE));
$this->assertTrue($this->container['event']->isEventTriggered(Task::EVENT_CREATE_UPDATE));
// We change the assignee
$this->assertTrue($t->update(array('owner_id' => 1, 'id' => 1)));
$this->assertTrue($this->container['event']->isEventTriggered(Task::EVENT_ASSIGNEE_CHANGE));
}
}