aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/ContactsManagerTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/ContactsManagerTest.php')
-rw-r--r--tests/lib/ContactsManagerTest.php21
1 files changed, 10 insertions, 11 deletions
diff --git a/tests/lib/ContactsManagerTest.php b/tests/lib/ContactsManagerTest.php
index 6fea6b39e92..d2d46ce43b4 100644
--- a/tests/lib/ContactsManagerTest.php
+++ b/tests/lib/ContactsManagerTest.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
@@ -6,6 +7,8 @@
*/
namespace Test;
+use OC\ContactsManager;
+use OCP\Constants;
use OCP\IAddressBook;
class ContactsManagerTest extends \Test\TestCase {
@@ -14,7 +17,7 @@ class ContactsManagerTest extends \Test\TestCase {
protected function setUp(): void {
parent::setUp();
- $this->cm = new \OC\ContactsManager();
+ $this->cm = new ContactsManager();
}
public static function searchProvider(): array {
@@ -62,9 +65,7 @@ class ContactsManagerTest extends \Test\TestCase {
];
}
- /**
- * @dataProvider searchProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('searchProvider')]
public function testSearch($search1, $search2, $expectedResult): void {
/** @var \PHPUnit\Framework\MockObject\MockObject|IAddressBook $addressbook */
$addressbook1 = $this->getMockBuilder('\OCP\IAddressBookEnabled')
@@ -106,9 +107,7 @@ class ContactsManagerTest extends \Test\TestCase {
$this->assertEquals($expectedResult, $result);
}
- /**
- * @dataProvider searchProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('searchProvider')]
public function testSearchDisabledAb($search1): void {
/** @var \PHPUnit\Framework\MockObject\MockObject|IAddressBookEnabled $addressbook */
$addressbook1 = $this->getMockBuilder('\OCP\IAddressBookEnabled')
@@ -153,7 +152,7 @@ class ContactsManagerTest extends \Test\TestCase {
$addressbook->expects($this->any())
->method('getPermissions')
- ->willReturn(\OCP\Constants::PERMISSION_ALL);
+ ->willReturn(Constants::PERMISSION_ALL);
$addressbook->expects($this->once())
->method('delete')
@@ -176,7 +175,7 @@ class ContactsManagerTest extends \Test\TestCase {
$addressbook->expects($this->any())
->method('getPermissions')
- ->willReturn(\OCP\Constants::PERMISSION_READ);
+ ->willReturn(Constants::PERMISSION_READ);
$addressbook->expects($this->never())
->method('delete');
@@ -216,7 +215,7 @@ class ContactsManagerTest extends \Test\TestCase {
$addressbook->expects($this->any())
->method('getPermissions')
- ->willReturn(\OCP\Constants::PERMISSION_ALL);
+ ->willReturn(Constants::PERMISSION_ALL);
$addressbook->expects($this->once())
->method('createOrUpdate')
@@ -239,7 +238,7 @@ class ContactsManagerTest extends \Test\TestCase {
$addressbook->expects($this->any())
->method('getPermissions')
- ->willReturn(\OCP\Constants::PERMISSION_READ);
+ ->willReturn(Constants::PERMISSION_READ);
$addressbook->expects($this->never())
->method('createOrUpdate');