diff options
| author | i00171 <anton.delitsch@implema.se> | 2016-06-26 18:35:25 +0200 |
|---|---|---|
| committer | i00171 <anton.delitsch@implema.se> | 2016-06-26 18:35:25 +0200 |
| commit | 47039d32c84ba699867920d2c3cb47a34b199b9d (patch) | |
| tree | 4fbc2ec34889baeab00085e0509055dca7daee6a /tests/integration/MeProcedureTest.php | |
| parent | 911be6ed00c1ece5d9ef2c16e80899bb7bffad67 (diff) | |
| parent | c110dffefe259c13e60193fb81ebb9d4b79504de (diff) | |
Merge branch 'master' of https://github.com/fguillot/kanboard
Diffstat (limited to 'tests/integration/MeProcedureTest.php')
| -rw-r--r-- | tests/integration/MeProcedureTest.php | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/tests/integration/MeProcedureTest.php b/tests/integration/MeProcedureTest.php new file mode 100644 index 00000000..2106419c --- /dev/null +++ b/tests/integration/MeProcedureTest.php @@ -0,0 +1,68 @@ +<?php + +require_once __DIR__.'/BaseProcedureTest.php'; + +class MeProcedureTest extends BaseProcedureTest +{ + protected $projectName = 'My private project'; + + public function testAll() + { + $this->assertGetMe(); + $this->assertCreateMyPrivateProject(); + $this->assertGetMyProjectsList(); + $this->assertGetMyProjects(); + $this->assertCreateTask(); + $this->assertGetMyDashboard(); + $this->assertGetMyActivityStream(); + } + + public function assertGetMe() + { + $profile = $this->user->getMe(); + $this->assertEquals('user', $profile['username']); + $this->assertEquals('app-user', $profile['role']); + } + + public function assertCreateMyPrivateProject() + { + $this->projectId = $this->user->createMyPrivateProject($this->projectName); + $this->assertNotFalse($this->projectId); + } + + public function assertGetMyProjectsList() + { + $projects = $this->user->getMyProjectsList(); + $this->assertNotEmpty($projects); + $this->assertEquals($this->projectName, $projects[$this->projectId]); + } + + public function assertGetMyProjects() + { + $projects = $this->user->getMyProjects(); + $this->assertNotEmpty($projects); + } + + public function assertCreateTask() + { + $taskId = $this->user->createTask(array('title' => 'My task', 'project_id' => $this->projectId, 'owner_id' => $this->userUserId)); + $this->assertNotFalse($taskId); + } + + public function assertGetMyDashboard() + { + $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']); + } + + public function assertGetMyActivityStream() + { + $activity = $this->user->getMyActivityStream(); + $this->assertNotEmpty($activity); + } +} |
