diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2014-09-23 13:45:21 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-09-23 13:45:21 +0200 |
commit | c587a4aaa212a48aca0b34fc2f9625774e02c472 (patch) | |
tree | 125b5ba8c98d5137e63e71c003135a9b338586d9 /tests/lib/util.php | |
parent | a062db4fd02feb1a0eff48eb130da7cc48c49899 (diff) | |
parent | 814114ab8eda5d383f4c620f3854cfefcdb6895d (diff) | |
download | nextcloud-server-c587a4aaa212a48aca0b34fc2f9625774e02c472.tar.gz nextcloud-server-c587a4aaa212a48aca0b34fc2f9625774e02c472.zip |
Merge pull request #11222 from owncloud/store-users-timezone-master
send browsers timezone back tp the server on login
Diffstat (limited to 'tests/lib/util.php')
-rw-r--r-- | tests/lib/util.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/lib/util.php b/tests/lib/util.php index 999c62486a7..600b794d8b8 100644 --- a/tests/lib/util.php +++ b/tests/lib/util.php @@ -37,6 +37,30 @@ class Test_Util extends PHPUnit_Framework_TestCase { $this->assertEquals($expected, $result); } + function testFormatDateWithTZ() { + date_default_timezone_set("UTC"); + + $result = OC_Util::formatDate(1350129205, false, 'Europe/Berlin'); + $expected = 'October 13, 2012 13:53'; + $this->assertEquals($expected, $result); + } + + /** + * @expectedException Exception + */ + function testFormatDateWithInvalidTZ() { + OC_Util::formatDate(1350129205, false, 'Mordor/Barad-dûr'); + } + + function testFormatDateWithTZFromSession() { + date_default_timezone_set("UTC"); + + \OC::$server->getSession()->set('timezone', 3); + $result = OC_Util::formatDate(1350129205, false); + $expected = 'October 13, 2012 14:53'; + $this->assertEquals($expected, $result); + } + function testCallRegister() { $result = strlen(OC_Util::callRegister()); $this->assertEquals(30, $result); |