summaryrefslogtreecommitdiff
path: root/tests/integration/AppProcedureTest.php
blob: 06135dac4f33fef0b0b67c402834d759a5b3ebc1 (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
47
48
49
50
51
52
53
54
<?php

require_once __DIR__.'/BaseProcedureTest.php';

class AppProcedureTest extends BaseProcedureTest
{
    public function testGetTimezone()
    {
        $this->assertEquals('UTC', $this->app->getTimezone());
    }

    public function testGetVersion()
    {
        $this->assertEquals('master', $this->app->getVersion());
    }

    public function testGetApplicationRoles()
    {
        $roles = $this->app->getApplicationRoles();
        $this->assertCount(3, $roles);
        $this->assertEquals('Administrator', $roles['app-admin']);
        $this->assertEquals('Manager', $roles['app-manager']);
        $this->assertEquals('User', $roles['app-user']);
    }

    public function testGetProjectRoles()
    {
        $roles = $this->app->getProjectRoles();
        $this->assertCount(3, $roles);
        $this->assertEquals('Project Manager', $roles['project-manager']);
        $this->assertEquals('Project Member', $roles['project-member']);
        $this->assertEquals('Project Viewer', $roles['project-viewer']);
    }

    public function testGetDefaultColor()
    {
        $this->assertEquals('yellow', $this->user->getDefaultTaskColor());
    }

    public function testGetDefaultColors()
    {
        $colors = $this->user->getDefaultTaskColors();
        $this->assertNotEmpty($colors);
        $this->assertArrayHasKey('red', $colors);
    }

    public function testGetColorList()
    {
        $colors = $this->user->getColorList();
        $this->assertNotEmpty($colors);
        $this->assertArrayHasKey('red', $colors);
        $this->assertEquals('Red', $colors['red']);
    }
}