summaryrefslogtreecommitdiff
path: root/tests/units/Model/TaskFinderTest.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-04-29 17:32:43 -0400
committerFrederic Guillot <fred@kanboard.net>2016-04-29 17:32:43 -0400
commitfc8f8748b9f89167ca9e6f4670bbc5e032e068b7 (patch)
treea7a5065e9a31dbd585439fdc2d8414abbfe074a6 /tests/units/Model/TaskFinderTest.php
parent81a25cbe6328eab7c4de0befc64186610ecc7f49 (diff)
Fixed wrong task link generation within Markdown text
Diffstat (limited to 'tests/units/Model/TaskFinderTest.php')
-rw-r--r--tests/units/Model/TaskFinderTest.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/units/Model/TaskFinderTest.php b/tests/units/Model/TaskFinderTest.php
index 0ed211ed..859a9ea6 100644
--- a/tests/units/Model/TaskFinderTest.php
+++ b/tests/units/Model/TaskFinderTest.php
@@ -93,4 +93,23 @@ class TaskFinderTest extends Base
$this->assertEquals(1, $tf->countByProjectId(1));
$this->assertEquals(2, $tf->countByProjectId(2));
}
+
+ public function testGetProjectToken()
+ {
+ $taskCreationModel = new TaskCreation($this->container);
+ $taskFinderModel = new TaskFinder($this->container);
+ $projectModel = new Project($this->container);
+
+ $this->assertEquals(1, $projectModel->create(array('name' => 'Project #1')));
+ $this->assertEquals(2, $projectModel->create(array('name' => 'Project #2')));
+
+ $this->assertTrue($projectModel->enablePublicAccess(1));
+
+ $this->assertEquals(1, $taskCreationModel->create(array('title' => 'Task #1', 'project_id' => 1)));
+ $this->assertEquals(2, $taskCreationModel->create(array('title' => 'Task #2', 'project_id' => 2)));
+
+ $project = $projectModel->getById(1);
+ $this->assertEquals($project['token'], $taskFinderModel->getProjectToken(1));
+ $this->assertEmpty($taskFinderModel->getProjectToken(2));
+ }
}