From c50255813b1f2de3709b17492d32c9e4ce280236 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Wed, 1 Jun 2016 21:28:24 -0400 Subject: Added mail helper --- tests/units/Core/ToolTest.php | 15 --------------- tests/units/Helper/MailHelperTest.php | 24 ++++++++++++++++++++++++ tests/units/Model/SwimlaneTest.php | 13 +++++++++++++ 3 files changed, 37 insertions(+), 15 deletions(-) delete mode 100644 tests/units/Core/ToolTest.php create mode 100644 tests/units/Helper/MailHelperTest.php (limited to 'tests') diff --git a/tests/units/Core/ToolTest.php b/tests/units/Core/ToolTest.php deleted file mode 100644 index 2422d73c..00000000 --- a/tests/units/Core/ToolTest.php +++ /dev/null @@ -1,15 +0,0 @@ -assertEquals('test1', Tool::getMailboxHash('a+test1@localhost')); - $this->assertEquals('', Tool::getMailboxHash('test1@localhost')); - $this->assertEquals('', Tool::getMailboxHash('test1')); - } -} diff --git a/tests/units/Helper/MailHelperTest.php b/tests/units/Helper/MailHelperTest.php new file mode 100644 index 00000000..9975dd29 --- /dev/null +++ b/tests/units/Helper/MailHelperTest.php @@ -0,0 +1,24 @@ +container); + $this->assertEquals('test1', $helper->getMailboxHash('a+test1@localhost')); + $this->assertEquals('', $helper->getMailboxHash('test1@localhost')); + $this->assertEquals('', $helper->getMailboxHash('test1')); + } + + public function testFilterSubject() + { + $helper = new MailHelper($this->container); + $this->assertEquals('Test', $helper->filterSubject('Test')); + $this->assertEquals('Test', $helper->filterSubject('RE: Test')); + $this->assertEquals('Test', $helper->filterSubject('FW: Test')); + } +} diff --git a/tests/units/Model/SwimlaneTest.php b/tests/units/Model/SwimlaneTest.php index 2594b17a..cf0be169 100644 --- a/tests/units/Model/SwimlaneTest.php +++ b/tests/units/Model/SwimlaneTest.php @@ -30,6 +30,19 @@ class SwimlaneTest extends Base $this->assertEquals('', $s->getNameById(23)); } + public function testGetFirstActiveSwimlane() + { + $projectModel = new ProjectModel($this->container); + $swimlaneModel = new SwimlaneModel($this->container); + + $this->assertEquals(1, $projectModel->create(array('name' => 'UnitTest'))); + $this->assertEquals(1, $swimlaneModel->create(array('project_id' => 1, 'name' => 'Swimlane #1', 'is_active' => 0))); + $this->assertEquals(2, $swimlaneModel->create(array('project_id' => 1, 'name' => 'Swimlane #2'))); + + $swimlane = $swimlaneModel->getFirstActiveSwimlane(1); + $this->assertEquals(2, $swimlane['id']); + } + public function testGetList() { $p = new ProjectModel($this->container); -- cgit v1.2.3