1616use OCP \Files \File ;
1717use OCP \Files \Folder ;
1818use OCP \Files \IRootFolder ;
19+ use OCP \IConfig ;
1920use OCP \IDBConnection ;
2021use OCP \IGroup ;
2122use OCP \IGroupManager ;
@@ -73,6 +74,8 @@ class DefaultShareProviderTest extends \Test\TestCase {
7374 /** @var LoggerInterface|MockObject */
7475 protected $ logger ;
7576
77+ protected IConfig &MockObject $ config ;
78+
7679 protected IShareManager &MockObject $ shareManager ;
7780
7881 protected function setUp (): void {
@@ -88,6 +91,7 @@ protected function setUp(): void {
8891 $ this ->timeFactory = $ this ->createMock (ITimeFactory::class);
8992 $ this ->logger = $ this ->createMock (LoggerInterface::class);
9093 $ this ->shareManager = $ this ->createMock (IShareManager::class);
94+ $ this ->config = $ this ->createMock (IConfig::class);
9195
9296 $ this ->userManager ->expects ($ this ->any ())->method ('userExists ' )->willReturn (true );
9397 $ this ->timeFactory ->expects ($ this ->any ())->method ('now ' )->willReturn (new \DateTimeImmutable ('2023-05-04 00:00 Europe/Berlin ' ));
@@ -107,6 +111,7 @@ protected function setUp(): void {
107111 $ this ->timeFactory ,
108112 $ this ->logger ,
109113 $ this ->shareManager ,
114+ $ this ->config ,
110115 );
111116 }
112117
@@ -471,6 +476,7 @@ public function testDeleteSingleShare(): void {
471476 $ this ->timeFactory ,
472477 $ this ->logger ,
473478 $ this ->shareManager ,
479+ $ this ->config ,
474480 ])
475481 ->setMethods (['getShareById ' ])
476482 ->getMock ();
@@ -568,6 +574,7 @@ public function testDeleteGroupShareWithUserGroupShares(): void {
568574 $ this ->timeFactory ,
569575 $ this ->logger ,
570576 $ this ->shareManager ,
577+ $ this ->config ,
571578 ])
572579 ->setMethods (['getShareById ' ])
573580 ->getMock ();
@@ -2572,6 +2579,7 @@ public function testGetSharesInFolder(): void {
25722579 $ this ->timeFactory ,
25732580 $ this ->logger ,
25742581 $ this ->shareManager ,
2582+ $ this ->config ,
25752583 );
25762584
25772585 $ password = md5 (time ());
@@ -2672,6 +2680,7 @@ public function testGetAccessListNoCurrentAccessRequired(): void {
26722680 $ this ->timeFactory ,
26732681 $ this ->logger ,
26742682 $ this ->shareManager ,
2683+ $ this ->config ,
26752684 );
26762685
26772686 $ u1 = $ userManager ->createUser ('testShare1 ' , 'test ' );
@@ -2775,6 +2784,7 @@ public function testGetAccessListCurrentAccessRequired(): void {
27752784 $ this ->timeFactory ,
27762785 $ this ->logger ,
27772786 $ this ->shareManager ,
2787+ $ this ->config ,
27782788 );
27792789
27802790 $ u1 = $ userManager ->createUser ('testShare1 ' , 'test ' );
0 commit comments