diff options
author | Frédéric Guillot <fred@kanboard.net> | 2015-01-02 21:11:19 -0500 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2015-01-02 21:11:19 -0500 |
commit | 45c95d74fc2115fe4cc7214553c0927d3ce9df8d (patch) | |
tree | 5135be8a33752cce4f1b457a5c379e02aaa65038 /tests/units/TaskCreationTest.php | |
parent | 3076ba22dd8346725b4e1ad757532c00df5b18d9 (diff) |
Various fixes and improvements
Diffstat (limited to 'tests/units/TaskCreationTest.php')
-rw-r--r-- | tests/units/TaskCreationTest.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/units/TaskCreationTest.php b/tests/units/TaskCreationTest.php index 41a3f276..bdb0a79d 100644 --- a/tests/units/TaskCreationTest.php +++ b/tests/units/TaskCreationTest.php @@ -48,11 +48,17 @@ class TaskCreationTest extends Base $this->container['dispatcher']->addListener(Task::EVENT_CREATE, function() {}); $this->assertEquals(1, $p->create(array('name' => 'test'))); - $this->assertEquals(0, $tc->create(array('project_id' => 1))); + $this->assertEquals(1, $tc->create(array('project_id' => 1))); $called = $this->container['dispatcher']->getCalledListeners(); - $this->assertArrayNotHasKey(Task::EVENT_CREATE_UPDATE.'.closure', $called); - $this->assertArrayNotHasKey(Task::EVENT_CREATE.'.closure', $called); + $this->assertArrayHasKey(Task::EVENT_CREATE_UPDATE.'.closure', $called); + $this->assertArrayHasKey(Task::EVENT_CREATE.'.closure', $called); + + $task = $tf->getById(1); + $this->assertNotEmpty($task); + $this->assertEquals(1, $task['id']); + $this->assertEquals('Untitled', $task['title']); + $this->assertEquals(1, $task['project_id']); } public function testMinimum() |