summaryrefslogtreecommitdiff
path: root/tests/integration
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2017-05-27 12:18:05 -0400
committerFrederic Guillot <fred@kanboard.net>2017-05-27 12:18:05 -0400
commitad8b1223cc7c4dbfc7245d630d1b4f4831a8c80f (patch)
treee74458231440a3b79fb7a6af263c2e88c70011ce /tests/integration
parent80d1293c42d5d7db1af278c2fbf12273dad4ba5f (diff)
Check owner existence before to create project
Diffstat (limited to 'tests/integration')
-rw-r--r--tests/integration/ProjectProcedureTest.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/integration/ProjectProcedureTest.php b/tests/integration/ProjectProcedureTest.php
index b55cfee2..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()
@@ -121,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']);
+ }
}