diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-06-26 15:47:02 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-06-26 15:47:02 -0400 |
commit | 82623f1a212a3a79507ede69586c561efa675224 (patch) | |
tree | c5b8607005950ff77c9782f4412f66d1b64bdfd7 /tests/integration/SubtaskTimeTrackingProcedureTest.php | |
parent | f62112983635a281108575bb69bb90df6bed68b7 (diff) |
Added API calls for subtask time tracking
Diffstat (limited to 'tests/integration/SubtaskTimeTrackingProcedureTest.php')
-rw-r--r-- | tests/integration/SubtaskTimeTrackingProcedureTest.php | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/tests/integration/SubtaskTimeTrackingProcedureTest.php b/tests/integration/SubtaskTimeTrackingProcedureTest.php new file mode 100644 index 00000000..6c45c983 --- /dev/null +++ b/tests/integration/SubtaskTimeTrackingProcedureTest.php @@ -0,0 +1,46 @@ +<?php + +require_once __DIR__.'/BaseProcedureTest.php'; + +class SubtaskTimeTrackingProcedureTest extends BaseProcedureTest +{ + protected $projectName = 'My project to test subtask time tracking'; + + public function testAll() + { + $this->assertCreateTeamProject(); + $this->assertCreateTask(); + $this->assertCreateSubtask(); + $this->assertHasNoTimer(); + $this->assertStartTimer(); + $this->assertHasTimer(); + $this->assertStopTimer(); + $this->assertHasNoTimer(); + $this->assertGetSubtaskTimeSpent(); + } + + public function assertHasNoTimer() + { + $this->assertFalse($this->app->hasSubtaskTimer($this->subtaskId, $this->userUserId)); + } + + public function assertHasTimer() + { + $this->assertTrue($this->app->hasSubtaskTimer($this->subtaskId, $this->userUserId)); + } + + public function assertStartTimer() + { + $this->assertTrue($this->app->setSubtaskStartTime($this->subtaskId, $this->userUserId)); + } + + public function assertStopTimer() + { + $this->assertTrue($this->app->setSubtaskEndTime($this->subtaskId, $this->userUserId)); + } + + public function assertGetSubtaskTimeSpent() + { + $this->assertEquals(0, $this->app->getSubtaskTimeSpent($this->subtaskId, $this->userUserId)); + } +} |