public function setUp() { $this->tearDown(); $bin = 'task'; if (file_exists(__DIR__ . '/../task')) { $bin = realpath(__DIR__ . '/../task'); } $this->taskwarrior = new Taskwarrior(__DIR__ . '/.taskrc', __DIR__ . '/.task', [], $bin); $this->taskwarrior->version(); // to initialise }
public function testModified() { if (version_compare($this->taskwarrior->version(), '2.2.0') < 0) { $this->markTestSkipped(sprintf('taskwarrior version %s dont support modified attr', $this->taskwarrior->version())); } $task1 = new Task(); $task1->setDescription('foo1'); $this->taskManager->save($task1); $this->assertInstanceOf('DateTime', $task1->getEntry()); $this->assertInstanceOf('DateTime', $task1->getModified()); $mod = $task1->getModified(); sleep(2); $task1->setDescription('bar2'); $this->taskManager->save($task1); $this->assertInstanceOf('DateTime', $task1->getEntry()); $this->assertInstanceOf('DateTime', $task1->getModified()); $this->assertNotEquals($mod, $task1->getModified()); }