summaryrefslogtreecommitdiff
path: root/plugins/Group_assign/Test/Helper/NewTaskHelperTest.php
diff options
context:
space:
mode:
authorDzial Techniczny WMW Projekt s.c <techniczna@wmwprojekt.pl>2019-12-10 11:34:53 +0100
committerDzial Techniczny WMW Projekt s.c <techniczna@wmwprojekt.pl>2019-12-10 11:34:53 +0100
commitb8fa0246803dab40cf57d40b45984c53046f2d55 (patch)
treedc92b167c7542137c385614a1d558e57669a4339 /plugins/Group_assign/Test/Helper/NewTaskHelperTest.php
parent2a43146236fd8fb16f84398d85720ad84aa0a0b1 (diff)
Plugins directory and local modifications
Diffstat (limited to 'plugins/Group_assign/Test/Helper/NewTaskHelperTest.php')
-rw-r--r--plugins/Group_assign/Test/Helper/NewTaskHelperTest.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/plugins/Group_assign/Test/Helper/NewTaskHelperTest.php b/plugins/Group_assign/Test/Helper/NewTaskHelperTest.php
new file mode 100644
index 00000000..8c378474
--- /dev/null
+++ b/plugins/Group_assign/Test/Helper/NewTaskHelperTest.php
@@ -0,0 +1,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)
+ );
+ }
+}