summaryrefslogtreecommitdiff
path: root/tests/units/ConfigTest.php
blob: 9ea9bc9a3775d0646d0ca887d344569af6fd6af5 (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
<?php

require_once __DIR__.'/Base.php';

use Model\Config;

class ConfigTest extends Base
{
    public function testDefaultValues()
    {
        $c = new Config($this->container);

        $this->assertEquals('en_US', $c->get('application_language'));
        $this->assertEquals('UTC', $c->get('application_timezone'));

        $this->assertEmpty($c->get('webhook_url_task_modification'));
        $this->assertEmpty($c->get('webhook_url_task_creation'));
        $this->assertEmpty($c->get('board_columns'));

        $this->assertNotEmpty($c->get('webhook_token'));
        $this->assertNotEmpty($c->get('api_token'));
    }

    public function testGet()
    {
        $c = new Config($this->container);

        $this->assertEquals('', $c->get('board_columns'));
        $this->assertEquals('test', $c->get('board_columns', 'test'));
        $this->assertEquals(0, $c->get('board_columns', 0));
    }
}