]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add explicit time to test date for clarity
authorDaniel Calviño Sánchez <danxuliu@gmail.com>
Thu, 12 Nov 2020 07:43:03 +0000 (08:43 +0100)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Mon, 16 Nov 2020 13:16:56 +0000 (13:16 +0000)
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>
tests/lib/Share20/ManagerTest.php

index a4647cfb9c645db8650b76c3010defce003b379c..1701f8f013732401260f7e97c5cf24185a03150b 100644 (file)
@@ -874,10 +874,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);
@@ -903,6 +903,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);
@@ -964,9 +965,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);