summaryrefslogtreecommitdiff
path: root/tests/units/Helper
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-01-24 20:38:39 -0500
committerFrederic Guillot <fred@kanboard.net>2016-01-24 20:38:39 -0500
commit051bf1c9dbb5733242c7657d6d507389206b33ee (patch)
tree9f1a61fa8558dd572b7c577f51599586e3c48a7e /tests/units/Helper
parent60f3d7f83d23014f9cfb7d8494d6cebd2f8b24a3 (diff)
Add configurable task priority
Diffstat (limited to 'tests/units/Helper')
-rw-r--r--tests/units/Helper/TaskHelperTest.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/units/Helper/TaskHelperTest.php b/tests/units/Helper/TaskHelperTest.php
new file mode 100644
index 00000000..726188e4
--- /dev/null
+++ b/tests/units/Helper/TaskHelperTest.php
@@ -0,0 +1,32 @@
+<?php
+
+require_once __DIR__.'/../Base.php';
+
+use Kanboard\Helper\Task;
+
+class TaskHelperTest extends Base
+{
+ public function testSelectPriority()
+ {
+ $helper = new Task($this->container);
+ $this->assertNotEmpty($helper->selectPriority(array('priority_end' => '3', 'priority_start' => '1', 'priority_default' => '2'), array()));
+ $this->assertEmpty($helper->selectPriority(array('priority_end' => '3', 'priority_start' => '3', 'priority_default' => '2'), array()));
+ }
+
+ public function testFormatPriority()
+ {
+ $helper = new Task($this->container);
+
+ $this->assertEquals(
+ '<span class="task-board-priority" title="Task priority">P2</span>',
+ $helper->formatPriority(array('priority_end' => '3', 'priority_start' => '1', 'priority_default' => '2'), array('priority' => 2))
+ );
+
+ $this->assertEquals(
+ '<span class="task-board-priority" title="Task priority">-P6</span>',
+ $helper->formatPriority(array('priority_end' => '3', 'priority_start' => '1', 'priority_default' => '2'), array('priority' => -6))
+ );
+
+ $this->assertEmpty($helper->formatPriority(array('priority_end' => '3', 'priority_start' => '3', 'priority_default' => '2'), array()));
+ }
+}