diff options
Diffstat (limited to 'tests/lib/Collaboration/Collaborators/MailPluginTest.php')
-rw-r--r-- | tests/lib/Collaboration/Collaborators/MailPluginTest.php | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/tests/lib/Collaboration/Collaborators/MailPluginTest.php b/tests/lib/Collaboration/Collaborators/MailPluginTest.php index 02b1034240f..b38b961a512 100644 --- a/tests/lib/Collaboration/Collaborators/MailPluginTest.php +++ b/tests/lib/Collaboration/Collaborators/MailPluginTest.php @@ -1,4 +1,5 @@ <?php + /** * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later @@ -63,11 +64,11 @@ class MailPluginTest extends TestCase { $this->userSession = $this->createMock(IUserSession::class); $this->mailer = $this->createMock(IMailer::class); $this->cloudIdManager = new CloudIdManager( + $this->createMock(ICacheFactory::class), + $this->createMock(IEventDispatcher::class), $this->contactsManager, $this->createMock(IURLGenerator::class), $this->createMock(IUserManager::class), - $this->createMock(ICacheFactory::class), - $this->createMock(IEventDispatcher::class) ); $this->searchResult = new SearchResult(); @@ -86,7 +87,6 @@ class MailPluginTest extends TestCase { } /** - * @dataProvider dataGetEmail * * @param string $searchTerm * @param array $contacts @@ -94,6 +94,7 @@ class MailPluginTest extends TestCase { * @param array $expected * @param bool $reachedEnd */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataGetEmail')] public function testSearch($searchTerm, $contacts, $shareeEnumeration, $expected, $exactIdMatch, $reachedEnd, $validEmail): void { $this->config->expects($this->any()) ->method('getAppValue') @@ -134,7 +135,7 @@ class MailPluginTest extends TestCase { $this->assertSame($reachedEnd, $moreResults); } - public function dataGetEmail() { + public static function dataGetEmail(): array { return [ // data set 0 ['test', [], true, ['emails' => [], 'exact' => ['emails' => []]], false, false, false], @@ -568,7 +569,6 @@ class MailPluginTest extends TestCase { } /** - * @dataProvider dataGetEmailGroupsOnly * * @param string $searchTerm * @param array $contacts @@ -577,6 +577,7 @@ class MailPluginTest extends TestCase { * @param bool $reachedEnd * @param array groups */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataGetEmailGroupsOnly')] public function testSearchGroupsOnly($searchTerm, $contacts, $expected, $exactIdMatch, $reachedEnd, $userToGroupMapping, $validEmail): void { $this->config->expects($this->any()) ->method('getAppValue') @@ -593,7 +594,7 @@ class MailPluginTest extends TestCase { $this->instantiatePlugin(); - /** @var \OCP\IUser | \PHPUnit\Framework\MockObject\MockObject */ + /** @var IUser|\PHPUnit\Framework\MockObject\MockObject */ $currentUser = $this->createMock('\OCP\IUser'); $currentUser->expects($this->any()) @@ -618,7 +619,7 @@ class MailPluginTest extends TestCase { $this->groupManager->expects($this->any()) ->method('getUserGroupIds') - ->willReturnCallback(function (\OCP\IUser $user) use ($userToGroupMapping) { + ->willReturnCallback(function (IUser $user) use ($userToGroupMapping) { return $userToGroupMapping[$user->getUID()]; }); @@ -636,7 +637,7 @@ class MailPluginTest extends TestCase { $this->assertSame($reachedEnd, $moreResults); } - public function dataGetEmailGroupsOnly() { + public static function dataGetEmailGroupsOnly(): array { return [ // The user `User` can share with the current user [ |