summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2020-11-12 08:43:03 +0100
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2020-11-12 11:57:34 +0100
commitbaaaacd6500f815f1a699d26f3a7ba02e0ba73e7 (patch)
tree141ad7b49837deadd799de9cd6cf276ef7c62087 /tests
parent578b57837ae5c64ae554a3d832df5e8743f640b6 (diff)
downloadnextcloud-server-baaaacd6500f815f1a699d26f3a7ba02e0ba73e7.tar.gz
nextcloud-server-baaaacd6500f815f1a699d26f3a7ba02e0ba73e7.zip
Add explicit time to test date for clarity
This shows in a clearer way that the expected expiration date is the original one, but without time. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/Share20/ManagerTest.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/lib/Share20/ManagerTest.php b/tests/lib/Share20/ManagerTest.php
index b152e80c146..e1db7932dc3 100644
--- a/tests/lib/Share20/ManagerTest.php
+++ b/tests/lib/Share20/ManagerTest.php
@@ -877,10 +877,10 @@ class ManagerTest extends \Test\TestCase {
public function testValidateExpirationDateEnforceValid() {
$future = new \DateTime();
$future->add(new \DateInterval('P2D'));
- $future->setTime(0,0,0);
+ $future->setTime(1,2,3);
$expected = clone $future;
- $future->setTime(1,2,3);
+ $expected->setTime(0,0,0);
$share = $this->manager->newShare();
$share->setExpirationDate($future);
@@ -906,6 +906,7 @@ class ManagerTest extends \Test\TestCase {
public function testValidateExpirationDateNoDefault() {
$date = new \DateTime();
$date->add(new \DateInterval('P5D'));
+ $date->setTime(1,2,3);
$expected = clone $date;
$expected->setTime(0,0,0);
@@ -967,9 +968,10 @@ class ManagerTest extends \Test\TestCase {
public function testValidateExpirationDateDefault() {
$future = new \DateTime();
$future->add(new \DateInterval('P5D'));
- $future->setTime(0,0,0);
+ $future->setTime(1,2,3);
$expected = clone $future;
+ $expected->setTime(0,0,0);
$share = $this->manager->newShare();
$share->setExpirationDate($future);