diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2024-02-01 16:13:27 +0100 |
---|---|---|
committer | Côme Chilliet <91878298+come-nc@users.noreply.github.com> | 2024-02-05 11:16:04 +0100 |
commit | b2e9e0fa0d6c50892e94b4ad325ef59fe41dfad9 (patch) | |
tree | 64e2799ed769ae19605eb94df57f995a02f3330b /tests | |
parent | 961ccee5f6cd08d8e06aea7f2e4e432cdb7d88e0 (diff) | |
download | nextcloud-server-b2e9e0fa0d6c50892e94b4ad325ef59fe41dfad9.tar.gz nextcloud-server-b2e9e0fa0d6c50892e94b4ad325ef59fe41dfad9.zip |
chore: Replace OC::$server->getL10N by OCP\Util::getL10N in lib and some apps
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/DateTimeFormatterTest.php | 6 | ||||
-rw-r--r-- | tests/lib/L10N/L10nTest.php | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/tests/lib/DateTimeFormatterTest.php b/tests/lib/DateTimeFormatterTest.php index 71d98ba7581..3409c0d9207 100644 --- a/tests/lib/DateTimeFormatterTest.php +++ b/tests/lib/DateTimeFormatterTest.php @@ -34,7 +34,7 @@ class DateTimeFormatterTest extends TestCase { protected function setUp(): void { parent::setUp(); - $this->formatter = new \OC\DateTimeFormatter(new \DateTimeZone('UTC'), \OC::$server->getL10N('lib', 'en')); + $this->formatter = new \OC\DateTimeFormatter(new \DateTimeZone('UTC'), \OCP\Util::getL10N('lib', 'en')); } protected function getTimestampAgo($time, $seconds = 0, $minutes = 0, $hours = 0, $days = 0, $years = 0) { @@ -43,7 +43,7 @@ class DateTimeFormatterTest extends TestCase { public function formatTimeSpanData() { $time = 1416916800; // Use a fixed timestamp so we don't switch days/years with the getTimestampAgo - $deL10N = \OC::$server->getL10N('lib', 'de'); + $deL10N = \OCP\Util::getL10N('lib', 'de'); return [ ['seconds ago', $time, $time], ['in a few seconds', $time + 5 , $time], @@ -84,7 +84,7 @@ class DateTimeFormatterTest extends TestCase { public function formatDateSpanData() { $time = 1416916800; // Use a fixed timestamp so we don't switch days/years with the getTimestampAgo - $deL10N = \OC::$server->getL10N('lib', 'de'); + $deL10N = \OCP\Util::getL10N('lib', 'de'); return [ // Normal testing ['today', $this->getTimestampAgo($time, 30, 15), $time], diff --git a/tests/lib/L10N/L10nTest.php b/tests/lib/L10N/L10nTest.php index bd1fce29547..9817f8b0141 100644 --- a/tests/lib/L10N/L10nTest.php +++ b/tests/lib/L10N/L10nTest.php @@ -201,12 +201,12 @@ class L10nTest extends TestCase { } public function testServiceGetLanguageCode() { - $l = \OC::$server->getL10N('lib', 'de'); + $l = \OCP\Util::getL10N('lib', 'de'); $this->assertEquals('de', $l->getLanguageCode()); } public function testWeekdayName() { - $l = \OC::$server->getL10N('lib', 'de'); + $l = \OCP\Util::getL10N('lib', 'de'); $this->assertEquals('Mo.', $l->l('weekdayName', new \DateTime('2017-11-6'), ['width' => 'abbreviated'])); } |