diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-05-28 19:48:22 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-05-28 19:48:22 -0400 |
commit | 14713b0ec7ed93ca45578da069ad4e19a7d8addf (patch) | |
tree | 79972d53f6091a1ddb17f64a6a05a5523f5d5168 /tests/units/Action/TaskEmailNoActivityTest.php | |
parent | 936376ffe74c583d3cb819e98f53a85137fdf8bc (diff) |
Rename all models
Diffstat (limited to 'tests/units/Action/TaskEmailNoActivityTest.php')
-rw-r--r-- | tests/units/Action/TaskEmailNoActivityTest.php | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/tests/units/Action/TaskEmailNoActivityTest.php b/tests/units/Action/TaskEmailNoActivityTest.php index af4baed5..c4d489d8 100644 --- a/tests/units/Action/TaskEmailNoActivityTest.php +++ b/tests/units/Action/TaskEmailNoActivityTest.php @@ -3,28 +3,28 @@ require_once __DIR__.'/../Base.php'; use Kanboard\Event\TaskListEvent; -use Kanboard\Model\TaskCreation; -use Kanboard\Model\TaskFinder; -use Kanboard\Model\Project; -use Kanboard\Model\Task; -use Kanboard\Model\User; +use Kanboard\Model\TaskCreationModel; +use Kanboard\Model\TaskFinderModel; +use Kanboard\Model\ProjectModel; +use Kanboard\Model\TaskModel; +use Kanboard\Model\UserModel; use Kanboard\Action\TaskEmailNoActivity; class TaskEmailNoActivityTest extends Base { public function testSendEmail() { - $userModel = new User($this->container); - $projectModel = new Project($this->container); - $taskCreationModel = new TaskCreation($this->container); - $taskFinderModel = new TaskFinder($this->container); + $userModel = new UserModel($this->container); + $projectModel = new ProjectModel($this->container); + $taskCreationModel = new TaskCreationModel($this->container); + $taskFinderModel = new TaskFinderModel($this->container); $this->assertEquals(2, $userModel->create(array('username' => 'test', 'email' => 'chuck@norris', 'name' => 'Chuck Norris'))); $this->assertEquals(1, $projectModel->create(array('name' => 'test1'))); $this->assertEquals(1, $taskCreationModel->create(array('project_id' => 1, 'title' => 'test'))); $this->assertEquals(2, $taskCreationModel->create(array('project_id' => 1, 'title' => 'test'))); - $this->container['db']->table(Task::TABLE)->eq('id', 1)->update(array('date_modification' => strtotime('-10days'))); + $this->container['db']->table(TaskModel::TABLE)->eq('id', 1)->update(array('date_modification' => strtotime('-10days'))); $tasks = $taskFinderModel->getAll(1); $event = new TaskListEvent(array('tasks' => $tasks, 'project_id' => 1)); @@ -40,22 +40,22 @@ class TaskEmailNoActivityTest extends Base ->method('send') ->with('chuck@norris', 'Chuck Norris', 'Old tasks', $this->anything()); - $this->assertTrue($action->execute($event, Task::EVENT_DAILY_CRONJOB)); + $this->assertTrue($action->execute($event, TaskModel::EVENT_DAILY_CRONJOB)); } public function testUserWithNoEmail() { - $userModel = new User($this->container); - $projectModel = new Project($this->container); - $taskCreationModel = new TaskCreation($this->container); - $taskFinderModel = new TaskFinder($this->container); + $userModel = new UserModel($this->container); + $projectModel = new ProjectModel($this->container); + $taskCreationModel = new TaskCreationModel($this->container); + $taskFinderModel = new TaskFinderModel($this->container); $this->assertEquals(2, $userModel->create(array('username' => 'test', 'name' => 'Chuck Norris'))); $this->assertEquals(1, $projectModel->create(array('name' => 'test1'))); $this->assertEquals(1, $taskCreationModel->create(array('project_id' => 1, 'title' => 'test'))); $this->assertEquals(2, $taskCreationModel->create(array('project_id' => 1, 'title' => 'test'))); - $this->container['db']->table(Task::TABLE)->eq('id', 1)->update(array('date_modification' => strtotime('-10days'))); + $this->container['db']->table(TaskModel::TABLE)->eq('id', 1)->update(array('date_modification' => strtotime('-10days'))); $tasks = $taskFinderModel->getAll(1); $event = new TaskListEvent(array('tasks' => $tasks, 'project_id' => 1)); @@ -70,15 +70,15 @@ class TaskEmailNoActivityTest extends Base ->expects($this->never()) ->method('send'); - $this->assertFalse($action->execute($event, Task::EVENT_DAILY_CRONJOB)); + $this->assertFalse($action->execute($event, TaskModel::EVENT_DAILY_CRONJOB)); } public function testTooRecent() { - $userModel = new User($this->container); - $projectModel = new Project($this->container); - $taskCreationModel = new TaskCreation($this->container); - $taskFinderModel = new TaskFinder($this->container); + $userModel = new UserModel($this->container); + $projectModel = new ProjectModel($this->container); + $taskCreationModel = new TaskCreationModel($this->container); + $taskFinderModel = new TaskFinderModel($this->container); $this->assertEquals(2, $userModel->create(array('username' => 'test', 'email' => 'chuck@norris', 'name' => 'Chuck Norris'))); $this->assertEquals(1, $projectModel->create(array('name' => 'test1'))); @@ -98,6 +98,6 @@ class TaskEmailNoActivityTest extends Base ->expects($this->never()) ->method('send'); - $this->assertFalse($action->execute($event, Task::EVENT_DAILY_CRONJOB)); + $this->assertFalse($action->execute($event, TaskModel::EVENT_DAILY_CRONJOB)); } } |