aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/DateTimeFormatterTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/DateTimeFormatterTest.php')
-rw-r--r--tests/lib/DateTimeFormatterTest.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/lib/DateTimeFormatterTest.php b/tests/lib/DateTimeFormatterTest.php
index cfab1643beb..75784a50c08 100644
--- a/tests/lib/DateTimeFormatterTest.php
+++ b/tests/lib/DateTimeFormatterTest.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
@@ -7,6 +8,9 @@
namespace Test;
+use OC\DateTimeFormatter;
+use OCP\Util;
+
class DateTimeFormatterTest extends TestCase {
/** @var \OC\DateTimeFormatter */
protected $formatter;
@@ -33,7 +37,7 @@ class DateTimeFormatterTest extends TestCase {
protected function setUp(): void {
parent::setUp();
- $this->formatter = new \OC\DateTimeFormatter(new \DateTimeZone('UTC'), \OCP\Util::getL10N('lib', 'en'));
+ $this->formatter = new DateTimeFormatter(new \DateTimeZone('UTC'), Util::getL10N('lib', 'en'));
}
protected static function getTimestampAgo($time, $seconds = 0, $minutes = 0, $hours = 0, $days = 0, $years = 0) {
@@ -42,7 +46,7 @@ class DateTimeFormatterTest extends TestCase {
public static function formatTimeSpanData(): array {
$time = 1416916800; // Use a fixed timestamp so we don't switch days/years with the getTimestampAgo
- $deL10N = \OCP\Util::getL10N('lib', 'de');
+ $deL10N = Util::getL10N('lib', 'de');
return [
['seconds ago', $time, $time],
['in a few seconds', $time + 5 , $time],
@@ -83,7 +87,7 @@ class DateTimeFormatterTest extends TestCase {
public static function formatDateSpanData(): array {
$time = 1416916800; // Use a fixed timestamp so we don't switch days/years with the getTimestampAgo
- $deL10N = \OCP\Util::getL10N('lib', 'de');
+ $deL10N = Util::getL10N('lib', 'de');
return [
// Normal testing
['today', self::getTimestampAgo($time, 30, 15), $time],