summaryrefslogtreecommitdiff
path: root/tests/integration/ProjectTest.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/ProjectTest.php
parent922e0fb6de06a98774418612e0b0f75af72b6dbb (diff)
Added application and project roles validation for API procedure calls
Diffstat (limited to 'tests/integration/ProjectTest.php')
-rw-r--r--tests/integration/ProjectTest.php89
1 files changed, 0 insertions, 89 deletions
diff --git a/tests/integration/ProjectTest.php b/tests/integration/ProjectTest.php
deleted file mode 100644
index 50d4fc53..00000000
--- a/tests/integration/ProjectTest.php
+++ /dev/null
@@ -1,89 +0,0 @@
-<?php
-
-require_once __DIR__.'/BaseIntegrationTest.php';
-
-class ProjectTest extends BaseIntegrationTest
-{
- protected $projectName = 'My team project';
-
- public function testAll()
- {
- $this->assertCreateTeamProject();
- $this->assertGetProjectById();
- $this->assertGetProjectByName();
- $this->assertGetAllProjects();
- $this->assertUpdateProject();
- $this->assertGetProjectActivity();
- $this->assertGetProjectsActivity();
- $this->assertEnableDisableProject();
- $this->assertEnableDisablePublicAccess();
- $this->assertRemoveProject();
- }
-
- public function assertGetProjectById()
- {
- $project = $this->app->getProjectById($this->projectId);
- $this->assertNotNull($project);
- $this->assertEquals($this->projectName, $project['name']);
- $this->assertEquals('Description', $project['description']);
- }
-
- public function assertGetProjectByName()
- {
- $project = $this->app->getProjectByName($this->projectName);
- $this->assertNotNull($project);
- $this->assertEquals($this->projectId, $project['id']);
- $this->assertEquals($this->projectName, $project['name']);
- $this->assertEquals('Description', $project['description']);
- }
-
- public function assertGetAllProjects()
- {
- $projects = $this->app->getAllProjects();
- $this->assertNotEmpty($projects);
- }
-
- public function assertGetProjectActivity()
- {
- $activities = $this->app->getProjectActivity($this->projectId);
- $this->assertInternalType('array', $activities);
- $this->assertCount(0, $activities);
- }
-
- public function assertGetProjectsActivity()
- {
- $activities = $this->app->getProjectActivities(array('project_ids' => array($this->projectId)));
- $this->assertInternalType('array', $activities);
- $this->assertCount(0, $activities);
- }
-
- public function assertUpdateProject()
- {
- $this->assertTrue($this->app->updateProject(array('project_id' => $this->projectId, 'name' => 'test', 'description' => 'test')));
-
- $project = $this->app->getProjectById($this->projectId);
- $this->assertNotNull($project);
- $this->assertEquals('test', $project['name']);
- $this->assertEquals('test', $project['description']);
-
- $this->assertTrue($this->app->updateProject(array('project_id' => $this->projectId, 'name' => $this->projectName)));
- }
-
- public function assertEnableDisableProject()
- {
- $this->assertTrue($this->app->disableProject($this->projectId));
- $this->assertTrue($this->app->enableProject($this->projectId));
- }
-
- public function assertEnableDisablePublicAccess()
- {
- $this->assertTrue($this->app->disableProjectPublicAccess($this->projectId));
- $this->assertTrue($this->app->enableProjectPublicAccess($this->projectId));
- }
-
- public function assertRemoveProject()
- {
- $this->assertTrue($this->app->removeProject($this->projectId));
- $this->assertNull($this->app->getProjectById($this->projectId));
- }
-}