|
|
|
|
@ -82,6 +82,8 @@ class DefaultShareProviderTest extends \Test\TestCase {
|
|
|
|
|
/** @var ITimeFactory|MockObject */
|
|
|
|
|
protected $timeFactory;
|
|
|
|
|
|
|
|
|
|
protected IShareManager&MockObject $shareManager;
|
|
|
|
|
|
|
|
|
|
protected function setUp(): void {
|
|
|
|
|
$this->dbConn = \OC::$server->getDatabaseConnection();
|
|
|
|
|
$this->userManager = $this->createMock(IUserManager::class);
|
|
|
|
|
@ -93,6 +95,7 @@ class DefaultShareProviderTest extends \Test\TestCase {
|
|
|
|
|
$this->defaults = $this->getMockBuilder(Defaults::class)->disableOriginalConstructor()->getMock();
|
|
|
|
|
$this->urlGenerator = $this->createMock(IURLGenerator::class);
|
|
|
|
|
$this->timeFactory = $this->createMock(ITimeFactory::class);
|
|
|
|
|
$this->shareManager = $this->createMock(IShareManager::class);
|
|
|
|
|
|
|
|
|
|
$this->userManager->expects($this->any())->method('userExists')->willReturn(true);
|
|
|
|
|
$this->timeFactory->expects($this->any())->method('now')->willReturn(new \DateTimeImmutable("2023-05-04 00:00 Europe/Berlin"));
|
|
|
|
|
@ -109,7 +112,8 @@ class DefaultShareProviderTest extends \Test\TestCase {
|
|
|
|
|
$this->defaults,
|
|
|
|
|
$this->l10nFactory,
|
|
|
|
|
$this->urlGenerator,
|
|
|
|
|
$this->timeFactory
|
|
|
|
|
$this->timeFactory,
|
|
|
|
|
$this->shareManager,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -470,7 +474,8 @@ class DefaultShareProviderTest extends \Test\TestCase {
|
|
|
|
|
$this->defaults,
|
|
|
|
|
$this->l10nFactory,
|
|
|
|
|
$this->urlGenerator,
|
|
|
|
|
$this->timeFactory
|
|
|
|
|
$this->timeFactory,
|
|
|
|
|
$this->shareManager,
|
|
|
|
|
])
|
|
|
|
|
->setMethods(['getShareById'])
|
|
|
|
|
->getMock();
|
|
|
|
|
@ -565,7 +570,8 @@ class DefaultShareProviderTest extends \Test\TestCase {
|
|
|
|
|
$this->defaults,
|
|
|
|
|
$this->l10nFactory,
|
|
|
|
|
$this->urlGenerator,
|
|
|
|
|
$this->timeFactory
|
|
|
|
|
$this->timeFactory,
|
|
|
|
|
$this->shareManager,
|
|
|
|
|
])
|
|
|
|
|
->setMethods(['getShareById'])
|
|
|
|
|
->getMock();
|
|
|
|
|
@ -2525,7 +2531,8 @@ class DefaultShareProviderTest extends \Test\TestCase {
|
|
|
|
|
$this->defaults,
|
|
|
|
|
$this->l10nFactory,
|
|
|
|
|
$this->urlGenerator,
|
|
|
|
|
$this->timeFactory
|
|
|
|
|
$this->timeFactory,
|
|
|
|
|
$this->shareManager,
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
$password = md5(time());
|
|
|
|
|
@ -2623,7 +2630,8 @@ class DefaultShareProviderTest extends \Test\TestCase {
|
|
|
|
|
$this->defaults,
|
|
|
|
|
$this->l10nFactory,
|
|
|
|
|
$this->urlGenerator,
|
|
|
|
|
$this->timeFactory
|
|
|
|
|
$this->timeFactory,
|
|
|
|
|
$this->shareManager,
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
$u1 = $userManager->createUser('testShare1', 'test');
|
|
|
|
|
@ -2719,7 +2727,8 @@ class DefaultShareProviderTest extends \Test\TestCase {
|
|
|
|
|
$this->defaults,
|
|
|
|
|
$this->l10nFactory,
|
|
|
|
|
$this->urlGenerator,
|
|
|
|
|
$this->timeFactory
|
|
|
|
|
$this->timeFactory,
|
|
|
|
|
$this->shareManager,
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
$u1 = $userManager->createUser('testShare1', 'test');
|
|
|
|
|
|