summaryrefslogtreecommitdiff
path: root/tests/units/Model/ProjectActivityTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/units/Model/ProjectActivityTest.php')
-rw-r--r--tests/units/Model/ProjectActivityTest.php38
1 files changed, 19 insertions, 19 deletions
diff --git a/tests/units/Model/ProjectActivityTest.php b/tests/units/Model/ProjectActivityTest.php
index 16036cd4..0b87b515 100644
--- a/tests/units/Model/ProjectActivityTest.php
+++ b/tests/units/Model/ProjectActivityTest.php
@@ -2,43 +2,43 @@
require_once __DIR__.'/../Base.php';
-use Kanboard\Model\Task;
-use Kanboard\Model\TaskFinder;
-use Kanboard\Model\TaskCreation;
-use Kanboard\Model\ProjectActivity;
-use Kanboard\Model\Project;
+use Kanboard\Model\TaskModel;
+use Kanboard\Model\TaskFinderModel;
+use Kanboard\Model\TaskCreationModel;
+use Kanboard\Model\ProjectActivityModel;
+use Kanboard\Model\ProjectModel;
class ProjectActivityTest extends Base
{
public function testCreation()
{
- $projectActivity = new ProjectActivity($this->container);
- $taskCreation = new TaskCreation($this->container);
- $taskFinder = new TaskFinder($this->container);
- $projectModel = new Project($this->container);
+ $projectActivity = new ProjectActivityModel($this->container);
+ $taskCreation = new TaskCreationModel($this->container);
+ $taskFinder = new TaskFinderModel($this->container);
+ $projectModel = new ProjectModel($this->container);
$this->assertEquals(1, $projectModel->create(array('name' => 'Project #1')));
$this->assertEquals(1, $taskCreation->create(array('title' => 'Task #1', 'project_id' => 1)));
$this->assertEquals(2, $taskCreation->create(array('title' => 'Task #2', 'project_id' => 1)));
- $this->assertTrue($projectActivity->createEvent(1, 1, 1, Task::EVENT_CLOSE, array('task' => $taskFinder->getById(1))));
- $this->assertTrue($projectActivity->createEvent(1, 2, 1, Task::EVENT_UPDATE, array('task' => $taskFinder->getById(2))));
- $this->assertFalse($projectActivity->createEvent(1, 1, 0, Task::EVENT_OPEN, array('task' => $taskFinder->getById(1))));
+ $this->assertTrue($projectActivity->createEvent(1, 1, 1, TaskModel::EVENT_CLOSE, array('task' => $taskFinder->getById(1))));
+ $this->assertTrue($projectActivity->createEvent(1, 2, 1, TaskModel::EVENT_UPDATE, array('task' => $taskFinder->getById(2))));
+ $this->assertFalse($projectActivity->createEvent(1, 1, 0, TaskModel::EVENT_OPEN, array('task' => $taskFinder->getById(1))));
$events = $projectActivity->getQuery()->desc('id')->findAll();
$this->assertCount(2, $events);
$this->assertEquals(time(), $events[0]['date_creation'], '', 1);
- $this->assertEquals(Task::EVENT_UPDATE, $events[0]['event_name']);
- $this->assertEquals(Task::EVENT_CLOSE, $events[1]['event_name']);
+ $this->assertEquals(TaskModel::EVENT_UPDATE, $events[0]['event_name']);
+ $this->assertEquals(TaskModel::EVENT_CLOSE, $events[1]['event_name']);
}
public function testCleanup()
{
- $projectActivity = new ProjectActivity($this->container);
- $taskCreation = new TaskCreation($this->container);
- $taskFinder = new TaskFinder($this->container);
- $projectModel = new Project($this->container);
+ $projectActivity = new ProjectActivityModel($this->container);
+ $taskCreation = new TaskCreationModel($this->container);
+ $taskFinder = new TaskFinderModel($this->container);
+ $projectModel = new ProjectModel($this->container);
$this->assertEquals(1, $projectModel->create(array('name' => 'Project #1')));
$this->assertEquals(1, $taskCreation->create(array('title' => 'Task #1', 'project_id' => 1)));
@@ -48,7 +48,7 @@ class ProjectActivityTest extends Base
$task = $taskFinder->getById(1);
for ($i = 0; $i < $nb_events; $i++) {
- $this->assertTrue($projectActivity->createEvent(1, 1, 1, Task::EVENT_CLOSE, array('task' => $task)));
+ $this->assertTrue($projectActivity->createEvent(1, 1, 1, TaskModel::EVENT_CLOSE, array('task' => $task)));
}
$this->assertEquals($nb_events, $this->container['db']->table('project_activities')->count());