From 051bf1c9dbb5733242c7657d6d507389206b33ee Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 24 Jan 2016 20:38:39 -0500 Subject: Add configurable task priority --- tests/units/Helper/TaskHelperTest.php | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 tests/units/Helper/TaskHelperTest.php (limited to 'tests/units/Helper') 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 @@ +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( + 'P2', + $helper->formatPriority(array('priority_end' => '3', 'priority_start' => '1', 'priority_default' => '2'), array('priority' => 2)) + ); + + $this->assertEquals( + '-P6', + $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())); + } +} -- cgit v1.2.3