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>
This commit is contained in:
Daniel Calviño Sánchez 2020-11-12 08:43:03 +01:00
parent 578b57837a
commit baaaacd650
1 changed files with 5 additions and 3 deletions

View File

@ -877,10 +877,10 @@ class ManagerTest extends \Test\TestCase {
public function testValidateExpirationDateEnforceValid() { public function testValidateExpirationDateEnforceValid() {
$future = new \DateTime(); $future = new \DateTime();
$future->add(new \DateInterval('P2D')); $future->add(new \DateInterval('P2D'));
$future->setTime(0,0,0); $future->setTime(1,2,3);
$expected = clone $future; $expected = clone $future;
$future->setTime(1,2,3); $expected->setTime(0,0,0);
$share = $this->manager->newShare(); $share = $this->manager->newShare();
$share->setExpirationDate($future); $share->setExpirationDate($future);
@ -906,6 +906,7 @@ class ManagerTest extends \Test\TestCase {
public function testValidateExpirationDateNoDefault() { public function testValidateExpirationDateNoDefault() {
$date = new \DateTime(); $date = new \DateTime();
$date->add(new \DateInterval('P5D')); $date->add(new \DateInterval('P5D'));
$date->setTime(1,2,3);
$expected = clone $date; $expected = clone $date;
$expected->setTime(0,0,0); $expected->setTime(0,0,0);
@ -967,9 +968,10 @@ class ManagerTest extends \Test\TestCase {
public function testValidateExpirationDateDefault() { public function testValidateExpirationDateDefault() {
$future = new \DateTime(); $future = new \DateTime();
$future->add(new \DateInterval('P5D')); $future->add(new \DateInterval('P5D'));
$future->setTime(0,0,0); $future->setTime(1,2,3);
$expected = clone $future; $expected = clone $future;
$expected->setTime(0,0,0);
$share = $this->manager->newShare(); $share = $this->manager->newShare();
$share->setExpirationDate($future); $share->setExpirationDate($future);