summaryrefslogtreecommitdiff
path: root/tests/units
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-05-14 11:10:30 -0400
committerFrederic Guillot <fred@kanboard.net>2015-05-14 11:10:30 -0400
commitb028b3586c5022753e9ff390a042aac9f5b863f4 (patch)
tree4a3edfe63b61ada9bdb5015102cb479a89106d3f /tests/units
parent22f44ef78820e75ce21913140b50d15c7213ccca (diff)
Return application url if defined for the helper getCurrentBaseUrl()
Diffstat (limited to 'tests/units')
-rw-r--r--tests/units/HelperTest.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/units/HelperTest.php b/tests/units/HelperTest.php
index 8694e8a2..57d1940a 100644
--- a/tests/units/HelperTest.php
+++ b/tests/units/HelperTest.php
@@ -3,6 +3,7 @@
require_once __DIR__.'/Base.php';
use Core\Helper;
+use Model\Config;
class HelperTest extends Base
{
@@ -30,4 +31,20 @@ class HelperTest extends Base
)
);
}
+
+ 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());
+ }
}