summaryrefslogtreecommitdiff
path: root/tests/integration/MeTest.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-06-26 10:25:13 -0400
committerFrederic Guillot <fred@kanboard.net>2016-06-26 10:25:13 -0400
commit4a230d331ec220fc32a48525afb308af0d9787fa (patch)
tree514aa3d703155b7f97a2c77147c9fd74cef60f84 /tests/integration/MeTest.php
parent922e0fb6de06a98774418612e0b0f75af72b6dbb (diff)
Added application and project roles validation for API procedure calls
Diffstat (limited to 'tests/integration/MeTest.php')
-rw-r--r--tests/integration/MeTest.php73
1 files changed, 0 insertions, 73 deletions
diff --git a/tests/integration/MeTest.php b/tests/integration/MeTest.php
deleted file mode 100644
index 047ebf85..00000000
--- a/tests/integration/MeTest.php
+++ /dev/null
@@ -1,73 +0,0 @@
-<?php
-
-require_once __DIR__.'/BaseIntegrationTest.php';
-
-class MeTest extends BaseIntegrationTest
-{
- 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);
- $this->assertCount(1, $projects);
- $this->assertEquals($this->projectName, $projects[0]['name']);
- $this->assertNotEmpty($projects[0]['url']['calendar']);
- $this->assertNotEmpty($projects[0]['url']['board']);
- $this->assertNotEmpty($projects[0]['url']['list']);
- }
-
- 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);
- }
-}