Close all subtasks when a task is closed
This commit is contained in:
@@ -11,6 +11,28 @@ use Model\User;
|
||||
|
||||
class SubTaskTest extends Base
|
||||
{
|
||||
public function testCloseAll()
|
||||
{
|
||||
$tc = new TaskCreation($this->container);
|
||||
$s = new Subtask($this->container);
|
||||
$p = new Project($this->container);
|
||||
|
||||
$this->assertEquals(1, $p->create(array('name' => 'test1')));
|
||||
$this->assertEquals(1, $tc->create(array('title' => 'test 1', 'project_id' => 1)));
|
||||
|
||||
$this->assertEquals(1, $s->create(array('title' => 'subtask #1', 'task_id' => 1)));
|
||||
$this->assertEquals(2, $s->create(array('title' => 'subtask #2', 'task_id' => 1)));
|
||||
|
||||
$this->assertTrue($s->closeAll(1));
|
||||
|
||||
$subtasks = $s->getAll(1);
|
||||
$this->assertNotEmpty($subtasks);
|
||||
|
||||
foreach ($subtasks as $subtask) {
|
||||
$this->assertEquals(Subtask::STATUS_DONE, $subtask['status']);
|
||||
}
|
||||
}
|
||||
|
||||
public function testMoveUp()
|
||||
{
|
||||
$tc = new TaskCreation($this->container);
|
||||
|
||||
Reference in New Issue
Block a user