fix deleting recurring task
This commit is contained in:
parent
bcbb955e28
commit
4ebaee91aa
@ -133,13 +133,8 @@ class TaskManager
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($task->isRecurring()) {
|
$this->taskwarrior->delete($task->getUuid());
|
||||||
$task->setUntil('now');
|
$this->refresh($task);
|
||||||
$this->save($task);
|
|
||||||
} else {
|
|
||||||
$this->taskwarrior->delete($task->getUuid());
|
|
||||||
$this->refresh($task);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -670,8 +670,6 @@ class TaskManagerTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
public function testRecurringDelete()
|
public function testRecurringDelete()
|
||||||
{
|
{
|
||||||
$this->markTestIncomplete('not working yet');
|
|
||||||
|
|
||||||
$recur1 = new Recurring(Recurring::DAILY);
|
$recur1 = new Recurring(Recurring::DAILY);
|
||||||
|
|
||||||
$task1 = new Task();
|
$task1 = new Task();
|
||||||
@ -683,12 +681,14 @@ class TaskManagerTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->taskManager->clear();
|
$this->taskManager->clear();
|
||||||
|
|
||||||
$this->assertCount(1, $this->taskManager->filterAll('status:recurring'));
|
$this->assertCount(1, $this->taskManager->filterAll('status:recurring'));
|
||||||
|
$this->assertCount(2, $this->taskManager->filterAll());
|
||||||
|
|
||||||
$this->taskManager->delete($task1);
|
$this->taskManager->delete($task1);
|
||||||
|
|
||||||
$this->taskManager->clear();
|
$this->taskManager->clear();
|
||||||
|
|
||||||
$this->assertCount(0, $this->taskManager->filterAll('status:recurring'));
|
$this->assertCount(0, $this->taskManager->filterAll('status:recurring'));
|
||||||
|
$this->assertCount(2, $this->taskManager->filterAll());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testUntil()
|
public function testUntil()
|
||||||
|
Loading…
Reference in New Issue
Block a user