summaryrefslogtreecommitdiff
path: root/tests/integration/SubtaskTimeTrackingProcedureTest.php
diff options
context:
space:
mode:
authorJLGC @monolinux <monolinux@junglacode.org>2016-08-15 23:13:16 -0500
committerJLGC @monolinux <monolinux@junglacode.org>2016-08-15 23:13:16 -0500
commit683c0464093f6a7976236c68653c2a2cc5dae280 (patch)
treebf176ecd82415cc4952eea071b7d264dd5fd68b4 /tests/integration/SubtaskTimeTrackingProcedureTest.php
parentb1e795fc5b45369f7b9b565b1e106d2673361977 (diff)
parent5f82a942c0011bf91947b2c1d627c0907bda0c92 (diff)
Merge https://github.com/kanboard/kanboard
Diffstat (limited to 'tests/integration/SubtaskTimeTrackingProcedureTest.php')
-rw-r--r--tests/integration/SubtaskTimeTrackingProcedureTest.php46
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));
+ }
+}