mirror of
https://github.com/nextcloud/server.git
synced 2026-06-14 03:02:01 -04:00
fix(tests): Adapt tests to change of DefaultShareProvider constructor
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
2e05ae2ffc
commit
716ecf4e37
1 changed files with 15 additions and 6 deletions
|
|
@ -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');
|
||||
|
|
|
|||
Loading…
Reference in a new issue