diff options
| author | Frederic Guillot <fred@kanboard.net> | 2015-07-08 19:59:17 -0400 |
|---|---|---|
| committer | Frederic Guillot <fred@kanboard.net> | 2015-07-08 19:59:17 -0400 |
| commit | f4fc02130ad7ee10f25baceb6bd00511d9de259d (patch) | |
| tree | 40177d1b56af968117a53d1081b6e3a3a120b3af /tests/units/TaskCreationTest.php | |
| parent | 61fb47bf3a595acf3c85707426890b2338b1d9b4 (diff) | |
Fix bug: No creator when duplicating a task
Diffstat (limited to 'tests/units/TaskCreationTest.php')
| -rw-r--r-- | tests/units/TaskCreationTest.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/units/TaskCreationTest.php b/tests/units/TaskCreationTest.php index 3dd2b714..03a85b64 100644 --- a/tests/units/TaskCreationTest.php +++ b/tests/units/TaskCreationTest.php @@ -175,6 +175,28 @@ class TaskCreationTest extends Base $this->assertEquals(1, $task['creator_id']); } + public function testThatCreatorIsDefined() + { + $p = new Project($this->container); + $tc = new TaskCreation($this->container); + $tf = new TaskFinder($this->container); + + $_SESSION = array(); + $_SESSION['user']['id'] = 1; + + $this->assertEquals(1, $p->create(array('name' => 'test'))); + $this->assertEquals(1, $tc->create(array('project_id' => 1, 'title' => 'test'))); + + $task = $tf->getById(1); + $this->assertNotEmpty($task); + $this->assertNotFalse($task); + + $this->assertEquals(1, $task['id']); + $this->assertEquals(1, $task['creator_id']); + + $_SESSION = array(); + } + public function testColumnId() { $p = new Project($this->container); |
