diff options
Diffstat (limited to 'tests/lib/Contacts/ContactsMenu/ManagerTest.php')
-rw-r--r-- | tests/lib/Contacts/ContactsMenu/ManagerTest.php | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/tests/lib/Contacts/ContactsMenu/ManagerTest.php b/tests/lib/Contacts/ContactsMenu/ManagerTest.php index 27ae9f5415c..dd6c634c740 100644 --- a/tests/lib/Contacts/ContactsMenu/ManagerTest.php +++ b/tests/lib/Contacts/ContactsMenu/ManagerTest.php @@ -57,7 +57,7 @@ class ManagerTest extends TestCase { return $entries; } - public function testGetFilteredEntries() { + public function testGetFilteredEntries(): void { $filter = 'con'; $user = $this->createMock(IUser::class); $entries = $this->generateTestEntries(); @@ -65,11 +65,10 @@ class ManagerTest extends TestCase { $this->config->expects($this->exactly(2)) ->method('getSystemValueInt') - ->withConsecutive( - ['sharing.maxAutocompleteResults', Constants::SHARING_MAX_AUTOCOMPLETE_RESULTS_DEFAULT], - ['sharing.minSearchStringLength', 0] - ) - ->willReturnOnConsecutiveCalls(25, 0); + ->willReturnMap([ + ['sharing.maxAutocompleteResults', Constants::SHARING_MAX_AUTOCOMPLETE_RESULTS_DEFAULT, 25], + ['sharing.minSearchStringLength', 0, 0], + ]); $this->contactsStore->expects($this->once()) ->method('getContacts') ->with($user, $filter) @@ -94,7 +93,7 @@ class ManagerTest extends TestCase { $this->assertEquals($expected, $data); } - public function testGetFilteredEntriesLimit() { + public function testGetFilteredEntriesLimit(): void { $filter = 'con'; $user = $this->createMock(IUser::class); $entries = $this->generateTestEntries(); @@ -102,11 +101,10 @@ class ManagerTest extends TestCase { $this->config->expects($this->exactly(2)) ->method('getSystemValueInt') - ->withConsecutive( - ['sharing.maxAutocompleteResults', Constants::SHARING_MAX_AUTOCOMPLETE_RESULTS_DEFAULT], - ['sharing.minSearchStringLength', 0] - ) - ->willReturnOnConsecutiveCalls(3, 0); + ->willReturnMap([ + ['sharing.maxAutocompleteResults', Constants::SHARING_MAX_AUTOCOMPLETE_RESULTS_DEFAULT, 3], + ['sharing.minSearchStringLength', 0, 0], + ]); $this->contactsStore->expects($this->once()) ->method('getContacts') ->with($user, $filter) @@ -131,18 +129,17 @@ class ManagerTest extends TestCase { $this->assertEquals($expected, $data); } - public function testGetFilteredEntriesMinSearchStringLength() { + public function testGetFilteredEntriesMinSearchStringLength(): void { $filter = 'con'; $user = $this->createMock(IUser::class); $provider = $this->createMock(IProvider::class); $this->config->expects($this->exactly(2)) ->method('getSystemValueInt') - ->withConsecutive( - ['sharing.maxAutocompleteResults', Constants::SHARING_MAX_AUTOCOMPLETE_RESULTS_DEFAULT], - ['sharing.minSearchStringLength', 0] - ) - ->willReturnOnConsecutiveCalls(3, 4); + ->willReturnMap([ + ['sharing.maxAutocompleteResults', Constants::SHARING_MAX_AUTOCOMPLETE_RESULTS_DEFAULT, 3], + ['sharing.minSearchStringLength', 0, 4], + ]); $this->appManager->expects($this->once()) ->method('isEnabledForUser') ->with($this->equalTo('contacts'), $user) @@ -157,7 +154,7 @@ class ManagerTest extends TestCase { $this->assertEquals($expected, $data); } - public function testFindOne() { + public function testFindOne(): void { $shareTypeFilter = 42; $shareWithFilter = 'foobar'; @@ -180,7 +177,7 @@ class ManagerTest extends TestCase { $this->assertEquals($entry, $data); } - public function testFindOne404() { + public function testFindOne404(): void { $shareTypeFilter = 42; $shareWithFilter = 'foobar'; |