summaryrefslogtreecommitdiff
path: root/plugins/Group_assign/Test/Helper/NewTaskHelperTest.php
blob: 8c378474d0a082fa8bcc20f55df7ca4c225a71c6 (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
<?php

require_once 'tests/units/Base.php';

use Kanboard\Core\Plugin\Loader;
use Kanboard\Plugin\Group_assign\Helper\NewTaskHelper;

class NewTaskHelperTest extends Base
{
    public function setUp()
    {
        parent::setUp();
        $plugin = new Loader($this->container);
        $plugin->scan();
    }
    public function testSelectPriority()
    {
        $helper = new NewTaskHelper($this->container);
        $this->assertNotEmpty($helper->renderPriorityField(array('priority_end' => '1', 'priority_start' => '5', 'priority_default' => '2'), array()));
        $this->assertNotEmpty($helper->renderPriorityField(array('priority_end' => '3', 'priority_start' => '1', 'priority_default' => '2'), array()));
    }
    public function testFormatPriority()
    {
        $helper = new NewTaskHelper($this->container);
        $this->assertEquals(
            '<span class="task-priority" title="Task priority">P2</span>',
            $helper->renderPriority(2)
        );
        $this->assertEquals(
            '<span class="task-priority" title="Task priority">-P6</span>',
            $helper->renderPriority(-6)
        );
    }
}