@@ -1164,7 +1164,7 @@ public function testValidateExpirationDateInternalEnforceButNotSetNewShare($shar
11641164 }
11651165
11661166 $ expected = new \DateTime ('now ' , $ this ->timezone );
1167- $ expected ->setTime (0 , 0 , 0 );
1167+ $ expected ->setTime (23 , 59 , 59 );
11681168 $ expected ->add (new \DateInterval ('P3D ' ));
11691169
11701170 self ::invokePrivate ($ this ->manager , 'validateExpirationDateInternal ' , [$ share ]);
@@ -1199,7 +1199,7 @@ public function testValidateExpirationDateInternalEnforceRelaxedDefaultButNotSet
11991199 }
12001200
12011201 $ expected = new \DateTime ('now ' , $ this ->timezone );
1202- $ expected ->setTime (0 , 0 , 0 );
1202+ $ expected ->setTime (23 , 59 , 59 );
12031203 $ expected ->add (new \DateInterval ('P1D ' ));
12041204
12051205 self ::invokePrivate ($ this ->manager , 'validateExpirationDateInternal ' , [$ share ]);
@@ -1250,7 +1250,7 @@ public function testValidateExpirationDateInternalEnforceValid($shareType) {
12501250 $ future ->setTime (1 , 2 , 3 );
12511251
12521252 $ expected = clone $ future ;
1253- $ expected ->setTime (0 , 0 , 0 );
1253+ $ expected ->setTime (23 , 59 , 59 );
12541254
12551255 $ share = $ this ->manager ->newShare ();
12561256 $ share ->setShareType ($ shareType );
@@ -1292,7 +1292,7 @@ public function testValidateExpirationDateInternalNoDefault($shareType) {
12921292 $ date ->setTime (1 , 2 , 3 );
12931293
12941294 $ expected = clone $ date ;
1295- $ expected ->setTime (0 , 0 , 0 );
1295+ $ expected ->setTime (23 , 59 , 59 );
12961296
12971297 $ share = $ this ->manager ->newShare ();
12981298 $ share ->setShareType ($ shareType );
@@ -1336,7 +1336,7 @@ public function testValidateExpirationDateInternalNoDateDefault($shareType) {
13361336 $ share ->setShareType ($ shareType );
13371337
13381338 $ expected = new \DateTime ('now ' , $ this ->timezone );
1339- $ expected ->setTime (0 , 0 );
1339+ $ expected ->setTime (23 , 59 , 59 );
13401340 $ expected ->add (new \DateInterval ('P3D ' ));
13411341 $ expected ->setTimezone (new \DateTimeZone (date_default_timezone_get ()));
13421342
@@ -1376,7 +1376,7 @@ public function testValidateExpirationDateInternalDefault($shareType) {
13761376 $ future ->setTime (1 , 2 , 3 );
13771377
13781378 $ expected = clone $ future ;
1379- $ expected ->setTime (0 , 0 );
1379+ $ expected ->setTime (23 , 59 , 59 );
13801380
13811381 $ share = $ this ->manager ->newShare ();
13821382 $ share ->setShareType ($ shareType );
@@ -1415,7 +1415,7 @@ public function testValidateExpirationDateInternalDefault($shareType) {
14151415 public function testValidateExpirationDateInternalHookModification ($ shareType ) {
14161416 $ nextWeek = new \DateTime ('now ' , $ this ->timezone );
14171417 $ nextWeek ->add (new \DateInterval ('P7D ' ));
1418- $ nextWeek ->setTime (0 , 0 , 0 );
1418+ $ nextWeek ->setTime (23 , 59 , 59 );
14191419
14201420 $ save = clone $ nextWeek ;
14211421
@@ -1444,7 +1444,7 @@ public function testValidateExpirationDateInternalHookException($shareType) {
14441444
14451445 $ nextWeek = new \DateTime ();
14461446 $ nextWeek ->add (new \DateInterval ('P7D ' ));
1447- $ nextWeek ->setTime (0 , 0 , 0 );
1447+ $ nextWeek ->setTime (23 , 59 , 59 );
14481448
14491449 $ share = $ this ->manager ->newShare ();
14501450 $ share ->setShareType ($ shareType );
@@ -1543,7 +1543,7 @@ public function testValidateExpirationDateEnforceButNotSetNewShare() {
15431543 ]);
15441544
15451545 $ expected = new \DateTime ('now ' , $ this ->timezone );
1546- $ expected ->setTime (0 , 0 , 0 );
1546+ $ expected ->setTime (23 , 59 , 59 );
15471547 $ expected ->add (new \DateInterval ('P3D ' ));
15481548
15491549 self ::invokePrivate ($ this ->manager , 'validateExpirationDateLink ' , [$ share ]);
@@ -1564,7 +1564,7 @@ public function testValidateExpirationDateEnforceRelaxedDefaultButNotSetNewShare
15641564 ]);
15651565
15661566 $ expected = new \DateTime ('now ' , $ this ->timezone );
1567- $ expected ->setTime (0 , 0 , 0 );
1567+ $ expected ->setTime (23 , 59 , 59 );
15681568 $ expected ->add (new \DateInterval ('P1D ' ));
15691569
15701570 self ::invokePrivate ($ this ->manager , 'validateExpirationDateLink ' , [$ share ]);
@@ -1599,7 +1599,7 @@ public function testValidateExpirationDateEnforceValid() {
15991599 $ future ->setTime (1 , 2 , 3 );
16001600
16011601 $ expected = clone $ future ;
1602- $ expected ->setTime (0 , 0 , 0 );
1602+ $ expected ->setTime (23 , 59 , 59 );
16031603
16041604 $ share = $ this ->manager ->newShare ();
16051605 $ share ->setExpirationDate ($ future );
@@ -1628,7 +1628,7 @@ public function testValidateExpirationDateNoDefault() {
16281628 $ date ->setTime (1 , 2 , 3 );
16291629
16301630 $ expected = clone $ date ;
1631- $ expected ->setTime (0 , 0 );
1631+ $ expected ->setTime (23 , 59 , 59 );
16321632 $ expected ->setTimezone (new \DateTimeZone (date_default_timezone_get ()));
16331633
16341634 $ share = $ this ->manager ->newShare ();
@@ -1665,7 +1665,7 @@ public function testValidateExpirationDateNoDateDefault() {
16651665
16661666 $ expected = new \DateTime ('now ' , $ this ->timezone );
16671667 $ expected ->add (new \DateInterval ('P3D ' ));
1668- $ expected ->setTime (0 , 0 );
1668+ $ expected ->setTime (23 , 59 , 59 );
16691669 $ expected ->setTimezone (new \DateTimeZone (date_default_timezone_get ()));
16701670
16711671 $ this ->config ->method ('getAppValue ' )
@@ -1692,7 +1692,7 @@ public function testValidateExpirationDateDefault() {
16921692 $ future ->setTime (1 , 2 , 3 );
16931693
16941694 $ expected = clone $ future ;
1695- $ expected ->setTime (0 , 0 );
1695+ $ expected ->setTime (23 , 59 , 59 );
16961696 $ expected ->setTimezone (new \DateTimeZone (date_default_timezone_get ()));
16971697
16981698 $ share = $ this ->manager ->newShare ();
@@ -1723,7 +1723,7 @@ public function testValidateExpirationNegativeOffsetTimezone() {
17231723
17241724 $ expected = clone $ future ;
17251725 $ expected ->setTimezone ($ this ->timezone );
1726- $ expected ->setTime (0 , 0 );
1726+ $ expected ->setTime (23 , 59 , 59 );
17271727 $ expected ->setTimezone (new \DateTimeZone (date_default_timezone_get ()));
17281728
17291729 $ share = $ this ->manager ->newShare ();
@@ -1752,7 +1752,7 @@ public function testValidateExpirationDateHookModification() {
17521752 $ nextWeek ->add (new \DateInterval ('P7D ' ));
17531753
17541754 $ save = clone $ nextWeek ;
1755- $ save ->setTime (0 , 0 );
1755+ $ save ->setTime (23 , 59 , 59 );
17561756 $ save ->sub (new \DateInterval ('P2D ' ));
17571757 $ save ->setTimezone (new \DateTimeZone (date_default_timezone_get ()));
17581758
@@ -1776,7 +1776,7 @@ public function testValidateExpirationDateHookException() {
17761776
17771777 $ nextWeek = new \DateTime ();
17781778 $ nextWeek ->add (new \DateInterval ('P7D ' ));
1779- $ nextWeek ->setTime (0 , 0 , 0 );
1779+ $ nextWeek ->setTime (23 , 59 , 59 );
17801780
17811781 $ share = $ this ->manager ->newShare ();
17821782 $ share ->setExpirationDate ($ nextWeek );
@@ -2436,7 +2436,7 @@ public function testCanShare($expected, $sharingEnabled, $disabledForUser) {
24362436 public function testCreateShareUser (): void {
24372437 /** @var Manager|MockObject $manager */
24382438 $ manager = $ this ->createManagerMock ()
2439- ->onlyMethods (['canShare ' , 'generalCreateChecks ' , 'userCreateChecks ' , 'pathCreateChecks ' ])
2439+ ->onlyMethods (['canShare ' , 'generalCreateChecks ' , 'userCreateChecks ' , 'pathCreateChecks ' , ' validateExpirationDateInternal ' ])
24402440 ->getMock ();
24412441
24422442 $ shareOwner = $ this ->createMock (IUser::class);
@@ -2472,6 +2472,10 @@ public function testCreateShareUser(): void {
24722472 $ manager ->expects ($ this ->once ())
24732473 ->method ('pathCreateChecks ' )
24742474 ->with ($ path );
2475+ $ manager ->expects ($ this ->once ())
2476+ ->method ('validateExpirationDateInternal ' )
2477+ ->with ($ share )
2478+ ->willReturnArgument (0 );
24752479
24762480 $ this ->defaultProvider
24772481 ->expects ($ this ->once ())
@@ -2491,7 +2495,7 @@ public function testCreateShareUser(): void {
24912495
24922496 public function testCreateShareGroup () {
24932497 $ manager = $ this ->createManagerMock ()
2494- ->setMethods (['canShare ' , 'generalCreateChecks ' , 'groupCreateChecks ' , 'pathCreateChecks ' ])
2498+ ->setMethods (['canShare ' , 'generalCreateChecks ' , 'groupCreateChecks ' , 'pathCreateChecks ' , ' validateExpirationDateInternal ' ])
24952499 ->getMock ();
24962500
24972501 $ shareOwner = $ this ->createMock (IUser::class);
@@ -2527,6 +2531,10 @@ public function testCreateShareGroup() {
25272531 $ manager ->expects ($ this ->once ())
25282532 ->method ('pathCreateChecks ' )
25292533 ->with ($ path );
2534+ $ manager ->expects ($ this ->once ())
2535+ ->method ('validateExpirationDateInternal ' )
2536+ ->with ($ share )
2537+ ->willReturnArgument (0 );
25302538
25312539 $ this ->defaultProvider
25322540 ->expects ($ this ->once ())
@@ -2778,6 +2786,7 @@ public function testCreateShareHookError() {
27782786 'generalCreateChecks ' ,
27792787 'userCreateChecks ' ,
27802788 'pathCreateChecks ' ,
2789+ 'validateExpirationDateInternal ' ,
27812790 ])
27822791 ->getMock ();
27832792
@@ -2814,6 +2823,10 @@ public function testCreateShareHookError() {
28142823 $ manager ->expects ($ this ->once ())
28152824 ->method ('pathCreateChecks ' )
28162825 ->with ($ path );
2826+ $ manager ->expects ($ this ->once ())
2827+ ->method ('validateExpirationDateInternal ' )
2828+ ->with ($ share )
2829+ ->willReturnArgument (0 );
28172830
28182831 $ share ->expects ($ this ->once ())
28192832 ->method ('setShareOwner ' )
@@ -2838,7 +2851,7 @@ public function testCreateShareHookError() {
28382851
28392852 public function testCreateShareOfIncomingFederatedShare () {
28402853 $ manager = $ this ->createManagerMock ()
2841- ->setMethods (['canShare ' , 'generalCreateChecks ' , 'userCreateChecks ' , 'pathCreateChecks ' ])
2854+ ->setMethods (['canShare ' , 'generalCreateChecks ' , 'userCreateChecks ' , 'pathCreateChecks ' , ' validateExpirationDateInternal ' ])
28422855 ->getMock ();
28432856
28442857 $ shareOwner = $ this ->createMock (IUser::class);
@@ -2893,6 +2906,10 @@ public function testCreateShareOfIncomingFederatedShare() {
28932906 $ manager ->expects ($ this ->once ())
28942907 ->method ('pathCreateChecks ' )
28952908 ->with ($ path );
2909+ $ manager ->expects ($ this ->once ())
2910+ ->method ('validateExpirationDateInternal ' )
2911+ ->with ($ share )
2912+ ->willReturnArgument (0 );
28962913
28972914 $ this ->defaultProvider
28982915 ->expects ($ this ->once ())
0 commit comments