diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2014-11-24 16:37:04 +0100 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-12-10 11:58:56 +0100 |
commit | 4d232e536eb03895863c0d7d7fe703c41d433f70 (patch) | |
tree | 2adb86d986c986f4c34fac9fedb287f9a51191d5 /tests/lib/template.php | |
parent | 681caf882a5f28b0b6f7cb9a1f16b3dea26ff5f2 (diff) | |
download | nextcloud-server-4d232e536eb03895863c0d7d7fe703c41d433f70.tar.gz nextcloud-server-4d232e536eb03895863c0d7d7fe703c41d433f70.zip |
Deprecate Util::formatDate()
Make DateTimeFormatter a service and adjust tests that have been inaccurate
Diffstat (limited to 'tests/lib/template.php')
-rw-r--r-- | tests/lib/template.php | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/lib/template.php b/tests/lib/template.php index d77284a5bf2..db58238eae8 100644 --- a/tests/lib/template.php +++ b/tests/lib/template.php @@ -117,15 +117,15 @@ class Test_TemplateFunctions extends \Test\TestCase { public function testRelativeDateMonthsAgo(){ $currentTime = 1380703592; - $elementTime = $currentTime - 86400 * 60; + $elementTime = $currentTime - 86400 * 65; $result = (string)relative_modified_date($elementTime, $currentTime, true); $this->assertEquals('2 months ago', $result); - $elementTime = $currentTime - 86400 * 65; + $elementTime = $currentTime - 86400 * 130; $result = (string)relative_modified_date($elementTime, $currentTime, true); - $this->assertEquals('2 months ago', $result); + $this->assertEquals('4 months ago', $result); } public function testRelativeDateLastYear(){ @@ -146,12 +146,12 @@ class Test_TemplateFunctions extends \Test\TestCase { $elementTime = $currentTime - 86400 * 365.25 * 2; $result = (string)relative_modified_date($elementTime, $currentTime, true); - $this->assertEquals('years ago', $result); + $this->assertEquals('2 years ago', $result); $elementTime = $currentTime - 86400 * 365.25 * 3; $result = (string)relative_modified_date($elementTime, $currentTime, true); - $this->assertEquals('years ago', $result); + $this->assertEquals('3 years ago', $result); } // --------------------------------------------------------------------------- @@ -211,15 +211,15 @@ class Test_TemplateFunctions extends \Test\TestCase { public function testRelativeTimeMonthsAgo(){ $currentTime = 1380703592; - $elementTime = $currentTime - 86400 * 60; + $elementTime = $currentTime - 86400 * 65; $result = (string)relative_modified_date($elementTime, $currentTime, false); $this->assertEquals('2 months ago', $result); - $elementTime = $currentTime - 86400 * 65; + $elementTime = $currentTime - 86400 * 130; $result = (string)relative_modified_date($elementTime, $currentTime, false); - $this->assertEquals('2 months ago', $result); + $this->assertEquals('4 months ago', $result); } public function testRelativeTimeLastYear(){ @@ -240,11 +240,11 @@ class Test_TemplateFunctions extends \Test\TestCase { $elementTime = $currentTime - 86400 * 365.25 * 2; $result = (string)relative_modified_date($elementTime, $currentTime, false); - $this->assertEquals('years ago', $result); + $this->assertEquals('2 years ago', $result); $elementTime = $currentTime - 86400 * 365.25 * 3; $result = (string)relative_modified_date($elementTime, $currentTime, false); - $this->assertEquals('years ago', $result); + $this->assertEquals('3 years ago', $result); } } |