]> source.dussan.org Git - nextcloud-server.git/commitdiff
Test for geo.php
authorLukas Reschke <lukas@statuscode.ch>
Sat, 13 Oct 2012 12:35:18 +0000 (14:35 +0200)
committerLukas Reschke <lukas@statuscode.ch>
Sat, 13 Oct 2012 12:35:20 +0000 (14:35 +0200)
tests/lib/geo.php [new file with mode: 0644]

diff --git a/tests/lib/geo.php b/tests/lib/geo.php
new file mode 100644 (file)
index 0000000..2b3599a
--- /dev/null
@@ -0,0 +1,19 @@
+<?php
+/**
+ * Copyright (c) 2012 Lukas Reschke <lukas@statuscode.ch>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+class Test_Geo extends UnitTestCase {
+       function testTimezone() {
+               $result = OC_Geo::timezone(3,3);
+               $expected = 'Africa/Porto-Novo';
+               $this->assertEquals($result, $expected);
+
+               $result = OC_Geo::timezone(-3,-3333);
+               $expected = 'Pacific/Enderbury';
+               $this->assertEquals($result, $expected);
+       }
+}
\ No newline at end of file