summaryrefslogtreecommitdiff
path: root/tests/units/Helper/AppHelperTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/units/Helper/AppHelperTest.php')
-rw-r--r--tests/units/Helper/AppHelperTest.php38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/units/Helper/AppHelperTest.php b/tests/units/Helper/AppHelperTest.php
new file mode 100644
index 00000000..54ccd697
--- /dev/null
+++ b/tests/units/Helper/AppHelperTest.php
@@ -0,0 +1,38 @@
+<?php
+
+require_once __DIR__.'/../Base.php';
+
+use Core\Session;
+use Helper\App;
+use Model\Config;
+
+class AppHelperTest extends Base
+{
+ public function testJsLang()
+ {
+ $h = new App($this->container);
+ $this->assertEquals('en', $h->jsLang());
+ }
+
+ public function testTimezone()
+ {
+ $h = new App($this->container);
+ $this->assertEquals('UTC', $h->getTimezone());
+ }
+
+ public function testFlashMessage()
+ {
+ $h = new App($this->container);
+ $s = new Session;
+
+ $this->assertEmpty($h->flashMessage());
+ $s->flash('test & test');
+ $this->assertEquals('<div class="alert alert-success alert-fade-out">test &amp; test</div>', $h->flashMessage());
+ $this->assertEmpty($h->flashMessage());
+
+ $this->assertEmpty($h->flashMessage());
+ $s->flashError('test & test');
+ $this->assertEquals('<div class="alert alert-error">test &amp; test</div>', $h->flashMessage());
+ $this->assertEmpty($h->flashMessage());
+ }
+}