From 710f2c7bb046b43ec9878ae795a181101f6d7515 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 5 Sep 2015 23:30:56 -0400 Subject: Improve unit tests --- tests/units/Helper/AppHelperTest.php | 38 ++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 tests/units/Helper/AppHelperTest.php (limited to 'tests/units/Helper/AppHelperTest.php') 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 @@ +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('
test & test
', $h->flashMessage()); + $this->assertEmpty($h->flashMessage()); + + $this->assertEmpty($h->flashMessage()); + $s->flashError('test & test'); + $this->assertEquals('
test & test
', $h->flashMessage()); + $this->assertEmpty($h->flashMessage()); + } +} -- cgit v1.2.3