6 Commits

Author SHA1 Message Date
Aerex
728fce1b78 fix: Created log file if files does not exist 2020-06-11 11:10:45 -05:00
Aerex
c302c4653a feat(tw): Applied timezone to datetimes that are not given in local time 2020-06-03 00:46:06 -05:00
Aerex
c2e181aa75 refactor: Added general config validations and timezone config 2020-06-03 00:04:43 -05:00
Aerex
00d0ea624f fix(tw): Reloaded tasks into object array for refresh
- chore(tw): Wrapped import function in try catch and logged error
2020-06-02 21:16:18 -05:00
Aerex
2f87752f6e fix: Used ArrayNodeDefinition to append taskwarrior config to main
config
2020-05-29 11:45:53 -05:00
Aerex
346e5c239b feat(tw): Added project_tag_suffix config to use tag for tw project 2020-05-28 11:54:21 -05:00
16 changed files with 278 additions and 116 deletions

1
.gitignore vendored
View File

@@ -1,3 +1,4 @@
vendor/ vendor/
main.uml main.uml
composer.lock composer.lock
.phpunit.result.cache

View File

@@ -29,7 +29,7 @@
"symfony/yaml": "~3.0|~4.0" "symfony/yaml": "~3.0|~4.0"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^7.4" "phpunit/phpunit": "^8.5.3"
}, },
"authors": [ "authors": [
{ {

7
config.yaml Executable file
View File

@@ -0,0 +1,7 @@
logger:
file: /home/aerex/baikal-storage-plugin.log
level: 'DEBUG'
taskwarrior:
taskdata: /home/aerex/.task
taskrc: /home/aerex/.taskrc
project_tag_suffix: project_

View File

@@ -6,13 +6,14 @@ use Symfony\Component\Config\Definition\ConfigurationInterface;
use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\Processor; use Symfony\Component\Config\Definition\Processor;
use Symfony\Component\Yaml\Yaml; use Symfony\Component\Yaml\Yaml;
use Carbon\CarbonTimeZone;
class ConfigBuilder implements ConfigurationInterface { class ConfigBuilder implements ConfigurationInterface {
private $configs = []; private $configs = [];
private $configDir; private $configFile;
public function __construct($configDir) { public function __construct($configFile) {
$this->configDir = $configDir; $this->configFile = $configFile;
$this->processor = new Processor(); $this->processor = new Processor();
} }
@@ -23,7 +24,33 @@ class ConfigBuilder implements ConfigurationInterface {
public function getConfigTreeBuilder() { public function getConfigTreeBuilder() {
$treeBuilder = new TreeBuilder(); $treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('configs'); $rootNode = $treeBuilder->root('configs');
$ref = $rootNode->children(); $ref = $rootNode->children()
->arrayNode('general')
->children()
->arrayNode('logger')
->canBeEnabled()
->children()
->scalarNode('file')->end()
->scalarNode('level')
->defaultValue('ERROR')
->validate()
->IfNotInArray(['DEBUG', 'INFO', 'NOTICE', 'WARNING', 'ERROR', 'CRITICAL', 'ALERT', 'EMERGENCY'])
->thenInvalid('Invalid log level %s')
->end()
->end()
->end()
->end()
->scalarNode('timezone')
->defaultValue('UTC')
->validate()
->IfNotInArray(CarbonTimeZone::listIdentifiers())
->thenInvalid('Invalid timezone identifier %s')
->end()
->end()
->end()
->end()
->arrayNode('storages')
->children();
foreach ($this->configs as $config) { foreach ($this->configs as $config) {
$ref = $ref->append($config->get()); $ref = $ref->append($config->get());
} }
@@ -32,8 +59,7 @@ class ConfigBuilder implements ConfigurationInterface {
} }
public function readContent() { public function readContent() {
$contents = sprintf('%s/storage.yaml', $this->configDir); return file_get_contents($this->configFile);
return file_get_contents($contents);
} }
public function loadYaml() { public function loadYaml() {

View File

@@ -2,19 +2,22 @@
namespace Aerex\BaikalStorage\Configs; namespace Aerex\BaikalStorage\Configs;
use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
class TaskwarriorConfig { class TaskwarriorConfig {
public function get() { public function get() {
$treeBuilder = new TreeBuilder(); $node = new ArrayNodeDefinition('taskwarrior');
$node = $treeBuilder->root('taskwarrior'); $node->canBeEnabled()
$node->children() ->children()
->scalarNode('taskdata') ->scalarNode('taskdata')
->defaultValue('~/.task') ->defaultValue('~/.task')
->end() ->end()
->scalarNode('taskrc') ->scalarNode('taskrc')
->defaultValue('~/.taskrc') ->defaultValue('~/.taskrc')
->end() ->end()
->scalarNode('project_tag_suffix')
->defaultValue('project_')
->end()
->end(); ->end();
return $node; return $node;

View File

@@ -23,16 +23,15 @@ class Console extends AbstractConsole {
$stdin = array_merge($stdin, $this->defaultArgs, $args); $stdin = array_merge($stdin, $this->defaultArgs, $args);
if (isset($input)) { if (isset($input)) {
$stdin[] = $this->convertToString($input); $input = $this->convertToString($input);
} }
$process = new Process(implode(' ', $stdin), $input, $envs); $process = new Process(implode(' ', $stdin), null, $envs, $input);
$process->inheritEnvironmentVariables(); $process->inheritEnvironmentVariables();
try { try {
$process->mustRun(); $process->mustRun();
return $process->getOutput(); return $process->getOutput();
} catch (ProcessFailedException $error) { } catch (ProcessFailedException $error) {
echo $error->getMessage();
throw $error; throw $error;
} }
} }

72
lib/Logger.php Normal file
View File

@@ -0,0 +1,72 @@
<?php
namespace Aerex\BaikalStorage;
use Monolog\Logger as Monolog;
use Monolog\Handler\StreamHandler;
class Logger {
private $configs = ['enabled' => false];
function __construct($configs, $tag) {
if (isset($configs['general']) && isset($configs['general']['logger'])) {
$this->configs = $configs['general']['logger'];
}
if ($this->configs['enabled']) {
$this->createLoggerFile();
$this->logger = new Monolog($tag);
$logLevel = Monolog::getLevels()[$this->configs['level']];
$this->logger->pushHandler(new StreamHandler($this->configs['file'], $logLevel));
}
}
private function createLoggerFile() {
if (!file_exists($this->configs['file'])) {
if (!fopen($this->configs['file'], 'w')) {
throw new \Exception(sprintf('Could not create logger file %s', $this->configs['file']));
}
}
}
public function debug($message) {
if ($this->configs['enabled']) {
$this->logger->debug($message);
}
}
public function info($message) {
if ($this->configs['enabled']) {
$this->logger->info($message);
}
}
public function notice($message) {
if ($this->configs['enabled']) {
$this->logger->notice($message);
}
}
public function error($message) {
if ($this->configs['enabled']) {
$this->logger->error($message);
}
}
public function critical($message) {
if ($this->configs['enabled']) {
$this->logger->critical($message);
}
}
public function alert($message) {
if ($this->configs['enabled']) {
$this->logger->alert($message);
}
}
public function emergency($message) {
if ($this->configs['enabled']) {
$this->logger->emergency($message);
}
}
}

View File

@@ -38,14 +38,14 @@ class Plugin extends ServerPlugin {
* @param CalendarProcessor $TWCalManager * @param CalendarProcessor $TWCalManager
* *
*/ */
function __construct($configDir){ function __construct($configFile){
$configs = $this->buildConfigurations($configDir); $configs = $this->buildConfigurations($configFile);
$this->storageManager = new StorageManager($configs); $this->storageManager = new StorageManager($configs);
$this->initializeStorages($configDir, $configs); $this->initializeStorages($configs);
} }
public function buildConfigurations($configDir) { public function buildConfigurations($configFile) {
$this->config = new ConfigBuilder($configDir); $this->config = new ConfigBuilder($configFile);
$this->config->add(new TaskwarriorConfig()); $this->config->add(new TaskwarriorConfig());
return $this->config->loadYaml(); return $this->config->loadYaml();
} }
@@ -55,8 +55,8 @@ class Plugin extends ServerPlugin {
* *
*/ */
public function initializeStorages($configDir, $configs) { public function initializeStorages($configs) {
$taskwarrior = new Taskwarrior(new Console(['rc.verbose=nothing', 'rc.hooks=off']), $configDir, $configs); $taskwarrior = new Taskwarrior(new Console(['rc.verbose=nothing', 'rc.hooks=off']), $configs);
$this->storageManager->addStorage(Taskwarrior::NAME, $taskwarrior); $this->storageManager->addStorage(Taskwarrior::NAME, $taskwarrior);
} }

View File

@@ -38,7 +38,7 @@ class StorageManager {
if (!isset($this->configs)) { if (!isset($this->configs)) {
throw new \Exception('StorageManger was not initialize or configs are not defined'); throw new \Exception('StorageManger was not initialize or configs are not defined');
} }
foreach ($this->configs as $key => $value) { foreach ($this->configs['storages'] as $key => $value) {
$storage = $this->storages[$key]; $storage = $this->storages[$key];
if (!isset($storage)){ if (!isset($storage)){
throw new \Exception(); throw new \Exception();

View File

@@ -3,19 +3,23 @@
namespace Aerex\BaikalStorage\Storages; namespace Aerex\BaikalStorage\Storages;
use Sabre\VObject\Component\VCalendar as Calendar; use Sabre\VObject\Component\VCalendar as Calendar;
use Aerex\BaikalStorage\Logger;
use Carbon\Carbon; use Carbon\Carbon;
use Carbon\CarbonTimeZone;
class Taskwarrior implements IStorage { class Taskwarrior implements IStorage {
private const DATA_FILES = ['pending.data', 'completed.data', 'undo.data'];
public const NAME = 'taskwarrior'; public const NAME = 'taskwarrior';
private $tasks = []; private $tasks = [];
private $configDir;
private $configs; private $configs;
public function __construct($console, $configDir, $configs) { private $logger;
private $tz;
public function __construct($console, $configs) {
$this->console = $console; $this->console = $console;
$this->configDir = $configDir; $this->configs = $configs['storages']['taskwarrior'];
$this->configs = $configs['taskwarrior']; $this->logger = new Logger($configs, 'Taskwarrior');
$this->tz = new CarbonTimeZone($configs['general']['timezone']);
} }
public function getConfig() { public function getConfig() {
@@ -23,62 +27,46 @@ class Taskwarrior implements IStorage {
} }
public function refresh() { public function refresh() {
$fp = fopen(sprintf('%s/taskwarrior-baikal-storage.lock', $this->configDir), 'a'); $output = $this->console->execute('task', ['sync'], null,
['TASKRC' => $this->configs['taskrc'],'TASKDATA' => $this->configs['taskdata']]);
if (!$fp || !flock($fp, LOCK_EX | LOCK_NB, $eWouldBlock) || $eWouldBlock) { $this->tasks = json_decode($this->console->execute('task', ['export'], null,
fputs(STDERR, 'Could not get lock');
}
$mtime = 0;
$tasksUpdated = false;
foreach (Taskwarrior::DATA_FILES as $dataFile) {
$fmtime = filemtime(sprintf('%s/%s', $this->configs['taskdata'], $dataFile));
if ($fmtime > $mtime) {
$mtime = $fmtime;
$tasksUpdated = true;
}
}
if ($tasksUpdated) {
$tasks = json_decode($this->console->execute('task', ['export'], null,
['TASKRC' => $this->configs['taskrc'], 'TASKDATA' => $this->configs['taskdata']]), true); ['TASKRC' => $this->configs['taskrc'], 'TASKDATA' => $this->configs['taskdata']]), true);
foreach ($tasks as $task) { foreach ($this->tasks as $task) {
$this->tasks[$task['uuid']] = $task; if (isset($task['uid'])) {
$this->tasks[$task['uid']] = $task;
} }
} }
fclose($fp); $this->logger->info($output);
unlink(sprintf('%s/taskwarrior-baikal-storage.lock', $this->configDir));
} }
public function vObjectToTask($vtodo) { public function vObjectToTask($vtodo) {
if (isset($this->tasks['uid']) && $this->tasks['uid'] == $vtodo->UID) { if (isset($this->tasks[(string)$vtodo->UID])) {
$task = $this->tasks['uid']; $task = $this->tasks[(string)$vtodo->UID];
} else { } else {
$task = []; $task = [];
$task['uid'] = (string)$vtodo->UID; $task['uid'] = (string)$vtodo->UID;
} }
if (isset($vtodo->SUMMARY)){
if (!isset($vtodo->DESCRIPTION) && isset($vtodo->SUMMARY)){
$task['description'] = (string)$vtodo->SUMMARY; $task['description'] = (string)$vtodo->SUMMARY;
} else { } else if(isset($vtodo->DESCRIPTION)) {
$task['description'] = (string)$vtodo->DESCRIPTION; $task['description'] = (string)$vtodo->DESCRIPTION;
} }
if (isset($vtodo->DTSTAMP)){ if (isset($vtodo->DTSTAMP)){
$task['entry'] = new Carbon($vtodo->DTSTAMP->getDateTime()->format(\DateTime::W3C)); $task['entry'] = new Carbon($vtodo->DTSTAMP->getDateTime()->format(\DateTime::W3C), $this->tz);
} }
if (isset($vtodo->DTSTART)) { if (isset($vtodo->DTSTART)) {
$task['start'] = new Carbon($vtodo->DTSTART->getDateTime()->format(\DateTime::W3C)); $task['start'] = new Carbon($vtodo->DTSTART->getDateTime()->format(\DateTime::W3C), $this->tz);
} }
if (isset($vtodo->DTEND)){ if (isset($vtodo->DTEND)){
$task['end'] = new Carbon($vtodo->DTEND->getDateTime()->format(\DateTime::W3C)); $task['end'] = new Carbon($vtodo->DTEND->getDateTime()->format(\DateTime::W3C), $this->tz);
} }
if (isset($vtodo->{'LAST-MODIFIED'})) { if (isset($vtodo->{'LAST-MODIFIED'})) {
$task['modified'] = new Carbon($vtodo->{'LAST-MODIFIED'}->getDateTime()->format(\DateTime::W3C)); $task['modified'] = new Carbon($vtodo->{'LAST-MODIFIED'}->getDateTime()->format(\DateTime::W3C), $this->tz);
} }
if (isset($vtodo->PRIORITY)) { if (isset($vtodo->PRIORITY)) {
@@ -93,7 +81,7 @@ class Taskwarrior implements IStorage {
} }
if (isset($vtodo->DUE)){ if (isset($vtodo->DUE)){
$task['due'] = new Carbon($vtodo->DUE->getDateTime()->format(\DateTime::W3C)); $task['due'] = new Carbon($vtodo->DUE->getDateTime());
} }
if (isset($vtodo->RRULE)) { if (isset($vtodo->RRULE)) {
@@ -114,25 +102,24 @@ class Taskwarrior implements IStorage {
case 'COMPLETED': case 'COMPLETED':
$task['status'] = 'completed'; $task['status'] = 'completed';
if (!isset($task['end'])) { if (!isset($task['end'])) {
$task['end'] = new Carbon($vtodo->DTSTAMP->getDateTime()->format(\DateTime::W3C)); $task['end'] = new Carbon($vtodo->DTSTAMP->getDateTime()->format(\DateTime::W3C), $this->tz);
} }
break; break;
case 'CANCELED': case 'CANCELED':
$task['status'] = 'deleted'; $task['status'] = 'deleted';
if (!isset($task['end'])) { if (!isset($task['end'])) {
$task['end'] = new Carbon($vtodo->DTSTAMP->getDateTime()->format(\DateTime::W3C)); $task['end'] = new Carbon($vtodo->DTSTAMP->getDateTime()->format(\DateTime::W3C), $this->tz);
} }
break; break;
} }
} }
if (isset($vtodo->CATEGORIES)) { if (isset($vtodo->CATEGORIES)) {
$task['tags'] = []; $task['tags'] = [];
foreach ($vtodo->CATEGORIES as $category) { foreach ($vtodo->CATEGORIES as $category) {
if (isset($this->configs['project_tag_suffix'])) { if (isset($this->configs['project_tag_suffix'])) {
$projTagSuffixRegExp = sprintf('/^%s_/', $this->configs['project_tag_suffix']); $projTagSuffixRegExp = sprintf('/^%s/', $this->configs['project_tag_suffix']);
if (preg_match($category, $projTagSuffixRegExp)) { if (preg_match($projTagSuffixRegExp, $category)) {
$task['project'] = preg_replace($projTagSuffixRegExp, '', $category); $task['project'] = preg_replace($projTagSuffixRegExp, '', $category);
continue; continue;
} }
@@ -145,12 +132,23 @@ class Taskwarrior implements IStorage {
} }
public function save(Calendar $c) { public function save(Calendar $c) {
try {
if (!isset($c->VTODO)){ if (!isset($c->VTODO)){
throw new \Exception('Calendar event does not contain VTODO'); throw new \Exception('Calendar event does not contain VTODO');
} }
$this->logger->info(json_encode($c->jsonSerialize()));
$this->refresh(); $this->refresh();
$task = $this->vObjectToTask($c->VTODO); $task = $this->vObjectToTask($c->VTODO);
$this->console->execute('task', ['import'], $task, $this->logger->info(json_encode($task));
$this->logger->info(
sprintf('Executing TASKRC = %s TASKDATA = %s task import %s', $this->configs['taskrc'], $this->configs['taskdata'], json_encode($task))
);
$output = $this->console->execute('task', ['import'], $task,
['TASKRC' => $this->configs['taskrc'],'TASKDATA' => $this->configs['taskdata']]); ['TASKRC' => $this->configs['taskrc'],'TASKDATA' => $this->configs['taskdata']]);
$this->logger->info($output);
} catch (\Exception $e) {
$this->logger->error($e->getTraceAsString());
throw $e;
}
} }
} }

View File

@@ -0,0 +1,49 @@
<?php
namespace Aerex\BaikalStorage;
use PHPUnit\Framework\TestCase;
use Aerex\BaikalStorage\Configs\ConfigBuilder;
use Aerex\BaikalStorage\Configs\TaskwarriorConfig;
class ConfigTest extends TestCase {
/**
* @var \PHPUnit_Framework_MockObject_MockObject
* */
public $mockConfigBuilder;
public function testGeneralLoggerConfigs() {
$configs = new ConfigBuilder(__DIR__ . '/Fixtures/LoggerConfig.yaml');
$contents = $configs->loadYaml();
$this->assertEquals(sizeof($contents), 1);
$this->assertArrayHasKey('general', $contents, 'config missing general config');
$generalConfigs = $contents['general'];
$this->assertArrayHasKey('logger', $generalConfigs, 'general config is missing logger property');
$this->assertArrayHasKey('file', $generalConfigs['logger'], 'general logger config missing file property');
$this->assertEquals($generalConfigs['logger']['file'], '/home/user/logger.yaml');
$this->assertArrayHasKey('level', $generalConfigs['logger'], 'general logger config missing level property');
$this->assertEquals($generalConfigs['logger']['level'], 'ERROR', 'ERROR is not set as default logger level');
$this->assertArrayHasKey('enabled', $generalConfigs['logger'], 'general config logger enabled property is missing');
$this->assertTrue($generalConfigs['logger']['enabled']);
$this->assertArrayHasKey('timezone', $generalConfigs, 'general config is missing timezone property');
$this->assertEquals($generalConfigs['timezone'], 'UTC', 'UTC is not set as default timezone');
}
public function testTaskwarriorConfig() {
$configs = new ConfigBuilder(__DIR__ . '/Fixtures/TaskwarriorConfig.yaml');
$configs->add(new TaskwarriorConfig());
$contents = $configs->loadYaml();
$this->assertEquals(sizeof($contents), 2);
$this->assertArrayHasKey('storages', $contents, 'storages config missing');
$this->assertArrayHasKey('taskwarrior', $contents['storages'], 'storage config missing taskwarrior property');
$taskwarriorConfigs = $contents['storages']['taskwarrior'];
$this->assertArrayHasKey('taskrc', $taskwarriorConfigs, 'taskwarrior config is missing taskrc property');
$this->assertEquals($taskwarriorConfigs['taskrc'], '/home/aerex/.taskrc');
$this->assertArrayHasKey('taskdata', $taskwarriorConfigs, 'taskwarrior config is missing taskdata property');
$this->assertEquals($taskwarriorConfigs['taskdata'], '/home/aerex/.task');
$this->assertArrayHasKey('project_tag_suffix', $taskwarriorConfigs, 'taskwarrior config is missing project_tag_suffix property');
$this->assertEquals($taskwarriorConfigs['project_tag_suffix'], 'project_');
}
}

View File

@@ -0,0 +1,3 @@
general:
logger:
file: /home/user/logger.yaml

View File

@@ -0,0 +1,10 @@
general:
logger:
file: /home/aerex/baikal-storage-plugin.log
level: DEBUG
timezone: 'America/Denver'
storages:
taskwarrior:
taskdata: /home/aerex/.task
taskrc: /home/aerex/.taskrc
project_tag_suffix: project_

View File

@@ -1,4 +0,0 @@
taskwarrior:
taskdata: '/home/user/.task'
taskrc: '~/home/user/.taskrc'
project_tag_suffix: 'project_'

View File

@@ -5,7 +5,6 @@ namespace Aerex\BaikalStorage;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use Aerex\BaikalStorage\AbstractConsole; use Aerex\BaikalStorage\AbstractConsole;
use Aerex\BaikalStorage\Configs\ConfigBuilder; use Aerex\BaikalStorage\Configs\ConfigBuilder;
use Aerex\BaikalStorage\Configs\TaskwarriorConfig;
use Aerex\BaikalStorage\Storages\Taskwarrior; use Aerex\BaikalStorage\Storages\Taskwarrior;
use Aerex\BaikalStorage\Storages\IStorage; use Aerex\BaikalStorage\Storages\IStorage;
use Sabre\VObject\Component\VCalendar as Calendar; use Sabre\VObject\Component\VCalendar as Calendar;
@@ -21,18 +20,18 @@ class StorageManagerTest extends TestCase {
public $mockConfigBuilder; public $mockConfigBuilder;
function setUp() { protected function setUp(): void {
$this->mockConfigBuilder = $this->getMockBuilder(ConfigBuilder::class) $this->mockConfigBuilder = $this->getMockBuilder(ConfigBuilder::class)
->setMethods(['readContent']) ->setMethods(['readContent'])
->setConstructorArgs(['']) ->setConstructorArgs([''])
->getMock(); ->getMock();
$this->mockConsole = $this->createMock(AbstractConsole::class); $this->mockConsole = $this->createMock(AbstractConsole::class);
$this->mockStorage = $this->createMock(IStorage::class); $this->mockStorage = $this->createMock(Taskwarrior::class);
} }
public function testAddTaskwarriorStorage() { public function testAddTaskwarriorStorage() {
$configs = ['taskwarrior' => ['taskrc' => '', 'taskdata' => '']]; $configs = ['taskwarrior' => ['taskrc' => '', 'taskdata' => '']];
$tw = new Taskwarrior($this->mockConsole, '', $configs); $tw = new Taskwarrior($this->mockConsole, $configs);
$manager = new StorageManager($this->mockConfigBuilder); $manager = new StorageManager($this->mockConfigBuilder);
$manager->addStorage(Taskwarrior::NAME, $tw); $manager->addStorage(Taskwarrior::NAME, $tw);
$storages = $manager->getStorages(); $storages = $manager->getStorages();

View File

@@ -14,13 +14,13 @@ class TaskwarriorTest extends TestCase {
* */ * */
private $mockConsole; private $mockConsole;
function setUp() { protected function setUp(): void {
$this->mockConsole = $this->createMock(AbstractConsole::class); $this->mockConsole = $this->createMock(AbstractConsole::class);
} }
public function testVObjectToTask() { public function testVObjectToTask() {
$configs = ['taskwarrior' => ['taskrc' => '', 'taskdata' => '']]; $configs = ['taskwarrior' => ['taskrc' => '', 'taskdata' => ''], 'logger' => ['file' => '', 'level'=> 'DEBUG', 'enabled' => true]];
$this->taskwarrior = new Taskwarrior($this->mockConsole, '', $configs); $this->taskwarrior = new Taskwarrior($this->mockConsole, $configs);
$vcalendar = new Calendar([ $vcalendar = new Calendar([
'VTODO' => [ 'VTODO' => [
'SUMMARY' => 'Finish project', 'SUMMARY' => 'Finish project',
@@ -33,7 +33,6 @@ class TaskwarriorTest extends TestCase {
'RRULE' => 'FREQ=MONTHLY' 'RRULE' => 'FREQ=MONTHLY'
] ]
]); ]);
echo $vcalendar->VTODO->RRULE->getJsonValue()[0]['freq'];
$task = $this->taskwarrior->vObjectToTask($vcalendar->VTODO); $task = $this->taskwarrior->vObjectToTask($vcalendar->VTODO);
$this->assertArrayHasKey('uid', $task, 'task should have a uid'); $this->assertArrayHasKey('uid', $task, 'task should have a uid');