|
|
|
@ -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], |
|
|
|
|