Merge pull request #17 from DavidBadura/taskwarrior-build

Taskwarrior 2.4.2
This commit is contained in:
David Badura 2015-04-22 14:09:05 +02:00
commit cc02f7aa60
3 changed files with 31 additions and 17 deletions

View File

@ -15,10 +15,17 @@ env:
- PREFER_LOWEST="" - PREFER_LOWEST=""
before_install: before_install:
- sudo add-apt-repository ppa:ultrafredde/ppa -y - wget http://taskwarrior.org/download/task-2.4.2.tar.gz
- sudo apt-get update -qq - gunzip task-2.4.2.tar.gz
- sudo apt-get install -qq task --force-yes - tar xf task-2.4.2.tar
- cd task-2.4.2
- sudo apt-get install cmake build-essential uuid-dev libgnutls-dev libreadline6-dev --force-yes
- sudo cmake -DCMAKE_BUILD_TYPE=release .
- sudo make
- sudo make install
- sudo ln -s /usr/local/bin/task /usr/bin/task
- task --version - task --version
- cd ..
before_script: before_script:
- composer self-update - composer self-update

View File

@ -255,19 +255,21 @@ class TaskManager
*/ */
private function edit(Task $task) private function edit(Task $task)
{ {
$this->taskwarrior->modify( $params = [
[ 'description' => $task->getDescription(),
'description' => $task->getDescription(), 'project' => $task->getProject(),
'project' => $task->getProject(), 'priority' => $task->getPriority(),
'priority' => $task->getPriority(), 'tags' => $task->getTags(),
'tags' => $task->getTags(), 'due' => $task->getDue() ? $task->getDue()->format('Ymd\THis\Z') : null,
'due' => $task->getDue() ? $task->getDue()->format('Ymd\THis\Z') : null, 'wait' => $task->getWait() ? $task->getWait()->format('Ymd\THis\Z') : null,
'wait' => $task->getWait() ? $task->getWait()->format('Ymd\THis\Z') : null, 'until' => $task->getUntil() ? $task->getUntil()->format('Ymd\THis\Z') : null
'until' => $task->getUntil() ? $task->getUntil()->format('Ymd\THis\Z') : null, ];
'recur' => $task->getRecurring() ? $task->getRecurring()->getValue() : null,
], if ($task->getRecurring()) {
$task->getUuid() $params['recur'] = $task->getRecurring()->getValue();
); }
$this->taskwarrior->modify($params, $task->getUuid());
} }
/** /**

View File

@ -196,7 +196,10 @@ class TaskManagerTest extends \PHPUnit_Framework_TestCase
$this->taskManager->save($task1); $this->taskManager->save($task1);
$this->assertInstanceOf('DateTime', $task1->getEntry()); $this->assertInstanceOf('DateTime', $task1->getEntry());
$this->assertNull($task1->getModified()); $this->assertInstanceOf('DateTime', $task1->getModified());
$mod = $task1->getModified();
sleep(2);
$task1->setDescription('bar2'); $task1->setDescription('bar2');
@ -204,6 +207,8 @@ class TaskManagerTest extends \PHPUnit_Framework_TestCase
$this->assertInstanceOf('DateTime', $task1->getEntry()); $this->assertInstanceOf('DateTime', $task1->getEntry());
$this->assertInstanceOf('DateTime', $task1->getModified()); $this->assertInstanceOf('DateTime', $task1->getModified());
$this->assertNotEquals($mod, $task1->getModified());
} }
public function testEnd() public function testEnd()