summaryrefslogtreecommitdiff
path: root/tests/integration/SubtaskTimeTrackingProcedureTest.php
blob: 6c45c98377a57e1e18b30a1b17dcc47973951462 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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));
    }
}