diff options
Diffstat (limited to 'tests/integration')
-rw-r--r-- | tests/integration/MeProcedureTest.php | 6 | ||||
-rw-r--r-- | tests/integration/OverdueTaskProcedureTest.php | 2 | ||||
-rw-r--r-- | tests/integration/ProjectProcedureTest.php | 25 | ||||
-rw-r--r-- | tests/integration/TaskProcedureTest.php | 2 |
4 files changed, 29 insertions, 6 deletions
diff --git a/tests/integration/MeProcedureTest.php b/tests/integration/MeProcedureTest.php index 2106419c..ed471b1b 100644 --- a/tests/integration/MeProcedureTest.php +++ b/tests/integration/MeProcedureTest.php @@ -53,11 +53,7 @@ class MeProcedureTest extends BaseProcedureTest { $dashboard = $this->user->getMyDashboard(); $this->assertNotEmpty($dashboard); - $this->assertArrayHasKey('projects', $dashboard); - $this->assertArrayHasKey('tasks', $dashboard); - $this->assertArrayHasKey('subtasks', $dashboard); - $this->assertNotEmpty($dashboard['projects']); - $this->assertNotEmpty($dashboard['tasks']); + $this->assertEquals('My task', $dashboard[0]['title']); } public function assertGetMyActivityStream() diff --git a/tests/integration/OverdueTaskProcedureTest.php b/tests/integration/OverdueTaskProcedureTest.php index 65f52301..0e31afa0 100644 --- a/tests/integration/OverdueTaskProcedureTest.php +++ b/tests/integration/OverdueTaskProcedureTest.php @@ -19,7 +19,7 @@ class OverdueTaskProcedureTest extends BaseProcedureTest $this->assertNotFalse($this->app->createTask(array( 'title' => 'overdue task', 'project_id' => $this->projectId, - 'date_due' => date('Y-m-d', strtotime('-2days')), + 'date_due' => date('Y-m-d H:i', strtotime('-2days')), ))); } diff --git a/tests/integration/ProjectProcedureTest.php b/tests/integration/ProjectProcedureTest.php index 69c2464f..12bb6d04 100644 --- a/tests/integration/ProjectProcedureTest.php +++ b/tests/integration/ProjectProcedureTest.php @@ -20,6 +20,7 @@ class ProjectProcedureTest extends BaseProcedureTest $this->assertEnableDisableProject(); $this->assertEnableDisablePublicAccess(); $this->assertRemoveProject(); + $this->assertCreateProjectWithOwnerId(); } public function assertGetProjectById() @@ -28,6 +29,8 @@ class ProjectProcedureTest extends BaseProcedureTest $this->assertNotNull($project); $this->assertEquals($this->projectName, $project['name']); $this->assertEquals('Description', $project['description']); + $this->assertArrayHasKey('board', $project['url']); + $this->assertArrayHasKey('list', $project['url']); } public function assertGetProjectByName() @@ -43,6 +46,9 @@ class ProjectProcedureTest extends BaseProcedureTest { $projects = $this->app->getAllProjects(); $this->assertNotEmpty($projects); + $this->assertInternalType('array', $projects); + $this->assertArrayHasKey('board', $projects[0]['url']); + $this->assertArrayHasKey('list', $projects[0]['url']); } public function assertGetProjectActivity() @@ -116,4 +122,23 @@ class ProjectProcedureTest extends BaseProcedureTest $this->assertTrue($this->app->removeProject($this->projectId)); $this->assertNull($this->app->getProjectById($this->projectId)); } + + public function assertCreateProjectWithOwnerId() + { + $this->assertFalse($this->app->createProject(array( + 'name' => 'My project with an owner', + 'owner_id' => 999, + ))); + + $projectId = $this->app->createProject(array( + 'name' => 'My project with an owner', + 'owner_id' => 1, + )); + + $this->assertNotFalse($projectId); + + $project = $this->app->getProjectById($projectId); + $this->assertEquals($projectId, $project['id']); + $this->assertEquals(1, $project['owner_id']); + } } diff --git a/tests/integration/TaskProcedureTest.php b/tests/integration/TaskProcedureTest.php index f456ae52..54527939 100644 --- a/tests/integration/TaskProcedureTest.php +++ b/tests/integration/TaskProcedureTest.php @@ -28,6 +28,7 @@ class TaskProcedureTest extends BaseProcedureTest $this->assertNotNull($task); $this->assertEquals('red', $task['color_id']); $this->assertEquals($this->taskTitle, $task['title']); + $this->assertArrayHasKey('url', $task); } public function assertGetTaskByReference() @@ -45,6 +46,7 @@ class TaskProcedureTest extends BaseProcedureTest $tasks = $this->app->getAllTasks($this->projectId); $this->assertInternalType('array', $tasks); $this->assertNotEmpty($tasks); + $this->assertArrayHasKey('url', $tasks[0]); } public function assertOpenCloseTask() |