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/Analytic | |
parent | 936376ffe74c583d3cb819e98f53a85137fdf8bc (diff) |
Rename all models
Diffstat (limited to 'tests/units/Analytic')
5 files changed, 46 insertions, 46 deletions
diff --git a/tests/units/Analytic/AverageLeadCycleTimeAnalyticTest.php b/tests/units/Analytic/AverageLeadCycleTimeAnalyticTest.php index b87e9573..831ec960 100644 --- a/tests/units/Analytic/AverageLeadCycleTimeAnalyticTest.php +++ b/tests/units/Analytic/AverageLeadCycleTimeAnalyticTest.php @@ -2,17 +2,17 @@ require_once __DIR__.'/../Base.php'; -use Kanboard\Model\TaskCreation; -use Kanboard\Model\Project; -use Kanboard\Model\Task; +use Kanboard\Model\TaskCreationModel; +use Kanboard\Model\ProjectModel; +use Kanboard\Model\TaskModel; use Kanboard\Analytic\AverageLeadCycleTimeAnalytic; class AverageLeadCycleTimeAnalyticTest extends Base { public function testBuild() { - $taskCreationModel = new TaskCreation($this->container); - $projectModel = new Project($this->container); + $taskCreationModel = new TaskCreationModel($this->container); + $projectModel = new ProjectModel($this->container); $averageLeadCycleTimeAnalytic = new AverageLeadCycleTimeAnalytic($this->container); $now = time(); @@ -26,19 +26,19 @@ class AverageLeadCycleTimeAnalyticTest extends Base $this->assertEquals(5, $taskCreationModel->create(array('project_id' => 1, 'title' => 'test'))); // LT=3600 CT=1800 - $this->container['db']->table(Task::TABLE)->eq('id', 1)->update(array('date_completed' => $now + 3600, 'date_started' => $now + 1800)); + $this->container['db']->table(TaskModel::TABLE)->eq('id', 1)->update(array('date_completed' => $now + 3600, 'date_started' => $now + 1800)); // LT=1800 CT=900 - $this->container['db']->table(Task::TABLE)->eq('id', 2)->update(array('date_completed' => $now + 1800, 'date_started' => $now + 900)); + $this->container['db']->table(TaskModel::TABLE)->eq('id', 2)->update(array('date_completed' => $now + 1800, 'date_started' => $now + 900)); // LT=3600 CT=0 - $this->container['db']->table(Task::TABLE)->eq('id', 3)->update(array('date_completed' => $now + 3600)); + $this->container['db']->table(TaskModel::TABLE)->eq('id', 3)->update(array('date_completed' => $now + 3600)); // LT=2*3600 CT=0 - $this->container['db']->table(Task::TABLE)->eq('id', 4)->update(array('date_completed' => $now + 2 * 3600)); + $this->container['db']->table(TaskModel::TABLE)->eq('id', 4)->update(array('date_completed' => $now + 2 * 3600)); // CT=0 - $this->container['db']->table(Task::TABLE)->eq('id', 5)->update(array('date_started' => $now + 900)); + $this->container['db']->table(TaskModel::TABLE)->eq('id', 5)->update(array('date_started' => $now + 900)); $stats = $averageLeadCycleTimeAnalytic->build(1); @@ -51,7 +51,7 @@ class AverageLeadCycleTimeAnalyticTest extends Base public function testBuildWithNoTasks() { - $projectModel = new Project($this->container); + $projectModel = new ProjectModel($this->container); $averageLeadCycleTimeAnalytic = new AverageLeadCycleTimeAnalytic($this->container); $this->assertEquals(1, $projectModel->create(array('name' => 'test1'))); diff --git a/tests/units/Analytic/AverageTimeSpentColumnAnalyticTest.php b/tests/units/Analytic/AverageTimeSpentColumnAnalyticTest.php index 4e01bfa9..1da425fb 100644 --- a/tests/units/Analytic/AverageTimeSpentColumnAnalyticTest.php +++ b/tests/units/Analytic/AverageTimeSpentColumnAnalyticTest.php @@ -2,19 +2,19 @@ require_once __DIR__.'/../Base.php'; -use Kanboard\Model\TaskCreation; -use Kanboard\Model\Project; -use Kanboard\Model\Transition; -use Kanboard\Model\Task; -use Kanboard\Model\TaskFinder; +use Kanboard\Model\TaskCreationModel; +use Kanboard\Model\ProjectModel; +use Kanboard\Model\TransitionModel; +use Kanboard\Model\TaskModel; +use Kanboard\Model\TaskFinderModel; use Kanboard\Analytic\AverageTimeSpentColumnAnalytic; class AverageTimeSpentColumnAnalyticTest extends Base { public function testAverageWithNoTransitions() { - $taskCreationModel = new TaskCreation($this->container); - $projectModel = new Project($this->container); + $taskCreationModel = new TaskCreationModel($this->container); + $projectModel = new ProjectModel($this->container); $averageLeadCycleTimeAnalytic = new AverageTimeSpentColumnAnalytic($this->container); $this->assertEquals(1, $projectModel->create(array('name' => 'test1'))); @@ -24,8 +24,8 @@ class AverageTimeSpentColumnAnalyticTest extends Base $now = time(); - $this->container['db']->table(Task::TABLE)->eq('id', 1)->update(array('date_completed' => $now + 3600)); - $this->container['db']->table(Task::TABLE)->eq('id', 2)->update(array('date_completed' => $now + 1800)); + $this->container['db']->table(TaskModel::TABLE)->eq('id', 1)->update(array('date_completed' => $now + 3600)); + $this->container['db']->table(TaskModel::TABLE)->eq('id', 2)->update(array('date_completed' => $now + 1800)); $stats = $averageLeadCycleTimeAnalytic->build(1); @@ -52,10 +52,10 @@ class AverageTimeSpentColumnAnalyticTest extends Base public function testAverageWithTransitions() { - $transitionModel = new Transition($this->container); - $taskFinderModel = new TaskFinder($this->container); - $taskCreationModel = new TaskCreation($this->container); - $projectModel = new Project($this->container); + $transitionModel = new TransitionModel($this->container); + $taskFinderModel = new TaskFinderModel($this->container); + $taskCreationModel = new TaskCreationModel($this->container); + $projectModel = new ProjectModel($this->container); $averageLeadCycleTimeAnalytic = new AverageTimeSpentColumnAnalytic($this->container); $this->assertEquals(1, $projectModel->create(array('name' => 'test1'))); @@ -64,8 +64,8 @@ class AverageTimeSpentColumnAnalyticTest extends Base $this->assertEquals(2, $taskCreationModel->create(array('project_id' => 1, 'title' => 'test'))); $now = time(); - $this->container['db']->table(Task::TABLE)->eq('id', 1)->update(array('date_completed' => $now + 3600)); - $this->container['db']->table(Task::TABLE)->eq('id', 2)->update(array('date_completed' => $now + 1800)); + $this->container['db']->table(TaskModel::TABLE)->eq('id', 1)->update(array('date_completed' => $now + 3600)); + $this->container['db']->table(TaskModel::TABLE)->eq('id', 2)->update(array('date_completed' => $now + 1800)); foreach (array(1, 2) as $task_id) { $task = $taskFinderModel->getById($task_id); diff --git a/tests/units/Analytic/EstimatedTimeComparisonAnalyticTest.php b/tests/units/Analytic/EstimatedTimeComparisonAnalyticTest.php index 2ca631b1..29bf88a3 100644 --- a/tests/units/Analytic/EstimatedTimeComparisonAnalyticTest.php +++ b/tests/units/Analytic/EstimatedTimeComparisonAnalyticTest.php @@ -2,16 +2,16 @@ require_once __DIR__.'/../Base.php'; -use Kanboard\Model\TaskCreation; -use Kanboard\Model\Project; +use Kanboard\Model\TaskCreationModel; +use Kanboard\Model\ProjectModel; use Kanboard\Analytic\EstimatedTimeComparisonAnalytic; class EstimatedTimeComparisonAnalyticTest extends Base { public function testBuild() { - $taskCreationModel = new TaskCreation($this->container); - $projectModel = new Project($this->container); + $taskCreationModel = new TaskCreationModel($this->container); + $projectModel = new ProjectModel($this->container); $estimatedTimeComparisonAnalytic = new EstimatedTimeComparisonAnalytic($this->container); $this->assertEquals(1, $projectModel->create(array('name' => 'test1'))); @@ -41,8 +41,8 @@ class EstimatedTimeComparisonAnalyticTest extends Base public function testBuildWithNoClosedTask() { - $taskCreationModel = new TaskCreation($this->container); - $projectModel = new Project($this->container); + $taskCreationModel = new TaskCreationModel($this->container); + $projectModel = new ProjectModel($this->container); $estimatedTimeComparisonAnalytic = new EstimatedTimeComparisonAnalytic($this->container); $this->assertEquals(1, $projectModel->create(array('name' => 'test1'))); @@ -70,8 +70,8 @@ class EstimatedTimeComparisonAnalyticTest extends Base public function testBuildWithOnlyClosedTask() { - $taskCreationModel = new TaskCreation($this->container); - $projectModel = new Project($this->container); + $taskCreationModel = new TaskCreationModel($this->container); + $projectModel = new ProjectModel($this->container); $estimatedTimeComparisonAnalytic = new EstimatedTimeComparisonAnalytic($this->container); $this->assertEquals(1, $projectModel->create(array('name' => 'test1'))); diff --git a/tests/units/Analytic/TaskDistributionAnalyticTest.php b/tests/units/Analytic/TaskDistributionAnalyticTest.php index 531101ef..0d600b8b 100644 --- a/tests/units/Analytic/TaskDistributionAnalyticTest.php +++ b/tests/units/Analytic/TaskDistributionAnalyticTest.php @@ -2,15 +2,15 @@ require_once __DIR__.'/../Base.php'; -use Kanboard\Model\TaskCreation; -use Kanboard\Model\Project; +use Kanboard\Model\TaskCreationModel; +use Kanboard\Model\ProjectModel; use Kanboard\Analytic\TaskDistributionAnalytic; class TaskDistributionAnalyticTest extends Base { public function testBuild() { - $projectModel = new Project($this->container); + $projectModel = new ProjectModel($this->container); $taskDistributionModel = new TaskDistributionAnalytic($this->container); $this->assertEquals(1, $projectModel->create(array('name' => 'test1'))); @@ -49,7 +49,7 @@ class TaskDistributionAnalyticTest extends Base private function createTasks($column_id, $nb_active, $nb_inactive) { - $taskCreationModel = new TaskCreation($this->container); + $taskCreationModel = new TaskCreationModel($this->container); for ($i = 0; $i < $nb_active; $i++) { $this->assertNotFalse($taskCreationModel->create(array('project_id' => 1, 'title' => 'test', 'column_id' => $column_id, 'is_active' => 1))); diff --git a/tests/units/Analytic/UserDistributionAnalyticTest.php b/tests/units/Analytic/UserDistributionAnalyticTest.php index bdc136e1..f4514899 100644 --- a/tests/units/Analytic/UserDistributionAnalyticTest.php +++ b/tests/units/Analytic/UserDistributionAnalyticTest.php @@ -2,10 +2,10 @@ require_once __DIR__.'/../Base.php'; -use Kanboard\Model\TaskCreation; -use Kanboard\Model\Project; -use Kanboard\Model\ProjectUserRole; -use Kanboard\Model\User; +use Kanboard\Model\TaskCreationModel; +use Kanboard\Model\ProjectModel; +use Kanboard\Model\ProjectUserRoleModel; +use Kanboard\Model\UserModel; use Kanboard\Analytic\UserDistributionAnalytic; use Kanboard\Core\Security\Role; @@ -13,9 +13,9 @@ class UserDistributionAnalyticTest extends Base { public function testBuild() { - $projectModel = new Project($this->container); - $projectUserRoleModel = new ProjectUserRole($this->container); - $userModel = new User($this->container); + $projectModel = new ProjectModel($this->container); + $projectUserRoleModel = new ProjectUserRoleModel($this->container); + $userModel = new UserModel($this->container); $userDistributionModel = new UserDistributionAnalytic($this->container); $this->assertEquals(1, $projectModel->create(array('name' => 'test1'))); @@ -70,7 +70,7 @@ class UserDistributionAnalyticTest extends Base private function createTasks($user_id, $nb_active, $nb_inactive) { - $taskCreationModel = new TaskCreation($this->container); + $taskCreationModel = new TaskCreationModel($this->container); for ($i = 0; $i < $nb_active; $i++) { $this->assertNotFalse($taskCreationModel->create(array('project_id' => 1, 'title' => 'test', 'owner_id' => $user_id, 'is_active' => 1))); |