コード例 #1
0
ファイル: SubtaskTest.php プロジェクト: perburn/kanboard
 public function testModification()
 {
     $tc = new TaskCreation($this->container);
     $s = new Subtask($this->container);
     $p = new Project($this->container);
     $this->assertEquals(1, $p->create(array('name' => 'test')));
     $this->assertEquals(1, $tc->create(array('title' => 'test 1', 'project_id' => 1)));
     $this->container['dispatcher']->addListener(Subtask::EVENT_UPDATE, array($this, 'onSubtaskUpdated'));
     $this->assertEquals(1, $s->create(array('title' => 'subtask #1', 'task_id' => 1)));
     $this->assertTrue($s->update(array('id' => 1, 'user_id' => 1, 'status' => Subtask::STATUS_INPROGRESS)));
     $subtask = $s->getById(1);
     $this->assertNotEmpty($subtask);
     $this->assertEquals(1, $subtask['id']);
     $this->assertEquals(1, $subtask['task_id']);
     $this->assertEquals('subtask #1', $subtask['title']);
     $this->assertEquals(Subtask::STATUS_INPROGRESS, $subtask['status']);
     $this->assertEquals(0, $subtask['time_estimated']);
     $this->assertEquals(0, $subtask['time_spent']);
     $this->assertEquals(1, $subtask['user_id']);
     $this->assertEquals(1, $subtask['position']);
 }