dox Executable Documentation

Storage

Read task

Given the default duration is 15 minutes
Given the folder 'root/__Task one'
Given the folder 'root/Task two'
When I read the tasks
Then there should be a task 'Task one'
Then 'Task one' should take 15 minutes
Then there should be a task 'Task two'
Then 'Task two' should take 0 minutes

Done task

Given the folder 'root/__one'
Given the folder 'root/X_two'
Given the folder 'root/x_three'
Given the folder 'root/x-men'
When I read the tasks
Then there should be a task 'one'
Then 'two' should be done
Then 'three' should be done
Then 'x-men' should be open

Read tree

Given the folder 'root/one'
Given the folder 'root/__two'
Given the folder 'root/one/__one one'
Given the folder 'root/one/__one two'
Given the folder 'root/one/__one two/__one two one'
When I read the tasks
Then there should be a task 'one'
Then there should be a task 'two'
Then there should be a task 'one/one one'
Then there should be a task 'one/one two'
Then there should be a task 'one/one two/one two one'
Then 'two' should have no children

Read priority

Given the folder 'root/__1_Some task'
Given the folder 'root/3_other task'
Given the folder 'root/__this task'
When I read the tasks
Then 'Some task' should have the priority 1
Then 'other task' should have the priority 3
Then 'this task' should have the priority Task::DEFAULT_PRIORITY

Read priority from file

Given the folder 'root/one'
Given the folder 'root/two'
Given the file 'root/one/__.txt' with content 'priority: 73'
When I read the tasks
Then 'one' should have the priority 73
Then 'two' should have the priority Task::DEFAULT_PRIORITY

Read duration

Given the folder 'root/one'
Given the folder 'root/two'
Given the file 'root/one/__.txt' with content 'duration: PT5H'
Given the file 'root/two/__.txt' with content 'duration: PT30M'
When I read the tasks
Then 'one' should take 300 minutes
Then 'two' should take 30 minutes

Read deadline

Given the folder 'root/__one'
Given the file 'root/__one/__.txt' with content 'deadline: 2014-12-31 12:00'
When I read the tasks
Then 'one' should have the deadline '2014-12-31 12:00'
Then 'one' should have no children

Read repeating task

Given the folder 'root/__one'
Given the file 'root/__one/__.txt' with content 'type: rtens\\xkdl\\task\\RepeatingTask ' . 'repeat: PT1H'
When I read the tasks
Then 'one' should be a repeating task
Then the repetition of 'one' should be 'PT1H'

Read windows

Given the folder 'root/__one'
Given the file 'root/__one/windows.txt' with content '2014-01-01 12:00 >> 2014-01-01 13:00 ' . '2014-01-01 14:00 >> 2014-01-01 15:00'
When I read the tasks
Then 'one' should have 2 windows

Read logs

Given the folder 'root/__one'
Given the file 'root/__one/logs.txt' with content '2014-01-01 12:00 >> 2014-01-01 13:00 ' . '2014-01-01 14:00 >> 2014-01-01 15:00'
When I read the tasks
Then 'one' should have 2 logs

Read description

Given the folder 'root/one'
Given the file 'root/one/description.txt' with content 'Some description'
When I read the tasks
Then there should be a task 'one'
Then 'one' should have the description 'Some description'

Add log to new task

Given the root task 'root'
Given the task 'one' in 'root'
Given the folder 'root'
When I add a log from '2014-01-01 12:00' until '2014-01-01 13:00' to 'one'
Then there should be a file 'root/one/logs.txt' with the content '2014-01-01T12:00:00+00:00 >> 2014-01-01T13:00:00+00:00 '

Add log to existing task

Given the root task 'root'
Given the task 'one' in 'root'
Given the task 'one/two' in 'root'
Given the folder 'root/one/two'
Given the file 'root/one/two/logs.txt' with content 'now >> tomorrow '
When I add a log from '2014-01-01 12:00' until '2014-01-01 13:00' to 'one/two'
Then there should be a file 'root/one/two/logs.txt' with the content 'now >> tomorrow -01-01T12:00:00+00:00 >> 2014-01-01T13:00:00+00:00 '

Add log to existing task with state and duration

Given the root task 'root'
Given the task 'one' in 'root'
Given the task 'one/two' in 'root'
Given the task 'three' in 'root'
Given the task 'four' in 'root'
Given the folder 'root/__one/x_two'
Given the folder 'root/__10_three'
Given the folder 'root/x_2_four'
When I add a log from '2014-01-01 12:00' until '2014-01-01 13:00' to 'one/two'
When I add a log from '2014-01-01 12:00' until '2014-01-01 13:00' to 'three'
When I add a log from '2014-01-01 12:00' until '2014-01-01 13:00' to 'four'
Then there should be a file 'root/__one/x_two/logs.txt'
Then there should be a file 'root/__10_three/logs.txt'
Then there should be a file 'root/x_2_four/logs.txt'

whenIAddALogFrom_Until_To

$writer = new Writer();
$writer->config = $this->config->getConfig();
$writer->addLog($task, new TimeWindow(new \DateTime($start), new \DateTime($end)));