Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-08-29 12:51:46 +0400
committerThomas Müller <thomas.mueller@tmit.eu>2013-08-29 12:51:46 +0400
commit04230907714d9a798fcfffd4a40792419d683d40 (patch)
treeb4c44676c8a19bae29c72e917b571086cef7a456 /tests
parentda504295fe7d6f360cbf6156f4c2edf5b3b521a8 (diff)
backport of #4360
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/l10n.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/lib/l10n.php b/tests/lib/l10n.php
new file mode 100644
index 00000000000..c0d28b5b860
--- /dev/null
+++ b/tests/lib/l10n.php
@@ -0,0 +1,23 @@
+<?php
+/**
+ * Copyright (c) 2013 Thomas Müller <thomas.mueller@tmit.eu>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+class Test_L10n extends PHPUnit_Framework_TestCase {
+
+ /**
+ * Issue #4360: Do not call strtotime() on numeric strings.
+ */
+ public function testNumericStringToDateTime() {
+ $l = new OC_L10N('test');
+ $this->assertSame('February 13, 2009 23:31', $l->l('datetime', '1234567890'));
+ }
+
+ public function testNumericToDateTime() {
+ $l = new OC_L10N('test');
+ $this->assertSame('February 13, 2009 23:31', $l->l('datetime', 1234567890));
+ }
+}