summaryrefslogtreecommitdiff
path: root/tests/units/HelperTest.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-05-24 16:02:25 -0400
committerFrederic Guillot <fred@kanboard.net>2015-05-24 16:02:25 -0400
commiteeac2329baab1fdae7cbf6c707ed2ffd8beb4c1b (patch)
tree511c2fe47f8fbb1ea90e59e7a7a7f5e3530aa9ed /tests/units/HelperTest.php
parent65e9e5d1bed9f88ecfd43eb2c1e780a7c22c151f (diff)
Helpers refactoring
Diffstat (limited to 'tests/units/HelperTest.php')
-rw-r--r--tests/units/HelperTest.php50
1 files changed, 0 insertions, 50 deletions
diff --git a/tests/units/HelperTest.php b/tests/units/HelperTest.php
deleted file mode 100644
index 57d1940a..00000000
--- a/tests/units/HelperTest.php
+++ /dev/null
@@ -1,50 +0,0 @@
-<?php
-
-require_once __DIR__.'/Base.php';
-
-use Core\Helper;
-use Model\Config;
-
-class HelperTest extends Base
-{
- public function testMarkdown()
- {
- $h = new Helper($this->container);
-
- $this->assertEquals('<p>Test</p>', $h->markdown('Test'));
-
- $this->assertEquals(
- '<p>Task #123</p>',
- $h->markdown('Task #123')
- );
-
- $this->assertEquals(
- '<p>Task <a href="?controller=a&amp;action=b&amp;c=d&amp;task_id=123">#123</a></p>',
- $h->markdown('Task #123', array('controller' => 'a', 'action' => 'b', 'params' => array('c' => 'd')))
- );
-
- $this->assertEquals(
- '<p>Check that: <a href="http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454">http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454</a></p>',
- $h->markdown(
- 'Check that: http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454',
- array('controller' => 'a', 'action' => 'b', 'params' => array('c' => 'd'))
- )
- );
- }
-
- public function testGetCurrentBaseUrl()
- {
- $h = new Helper($this->container);
-
- $_SERVER['PHP_SELF'] = '/';
- $_SERVER['SERVER_NAME'] = 'localhost';
- $_SERVER['SERVER_PORT'] = 1234;
-
- $this->assertEquals('http://localhost:1234/', $h->getCurrentBaseUrl());
-
- $c = new Config($this->container);
- $c->save(array('application_url' => 'https://mykanboard/'));
- $this->assertEquals('https://mykanboard/', $c->get('application_url'));
- $this->assertEquals('https://mykanboard/', $h->getCurrentBaseUrl());
- }
-}