From 5e23800a95290f5e4ca4d5eac8fa222b1ca34a34 Mon Sep 17 00:00:00 2001 From: John Molakvoæ Date: Wed, 20 Oct 2021 10:47:23 +0200 Subject: Do not remove current user on findOne MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ --- .../Contacts/ContactsMenu/ContactsStoreTest.php | 27 +++++++++++----------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'tests/lib/Contacts') diff --git a/tests/lib/Contacts/ContactsMenu/ContactsStoreTest.php b/tests/lib/Contacts/ContactsMenu/ContactsStoreTest.php index 13cc7575f43..98a31254c3e 100644 --- a/tests/lib/Contacts/ContactsMenu/ContactsStoreTest.php +++ b/tests/lib/Contacts/ContactsMenu/ContactsStoreTest.php @@ -99,7 +99,7 @@ class ContactsStoreTest extends TestCase { ], ], ]); - $user->expects($this->once()) + $user->expects($this->exactly(2)) ->method('getUID') ->willReturn('user123'); @@ -129,7 +129,7 @@ class ContactsStoreTest extends TestCase { ], ], ]); - $user->expects($this->once()) + $user->expects($this->exactly(2)) ->method('getUID') ->willReturn('user123'); @@ -157,7 +157,7 @@ class ContactsStoreTest extends TestCase { 'PHOTO' => base64_encode('photophotophoto'), ], ]); - $user->expects($this->once()) + $user->expects($this->exactly(2)) ->method('getUID') ->willReturn('user123'); @@ -186,7 +186,7 @@ class ContactsStoreTest extends TestCase { 'PHOTO' => 'VALUE=uri:https://photo', ], ]); - $user->expects($this->once()) + $user->expects($this->exactly(2)) ->method('getUID') ->willReturn('user123'); @@ -210,7 +210,7 @@ class ContactsStoreTest extends TestCase { /** @var IUser|\PHPUnit\Framework\MockObject\MockObject $currentUser */ $currentUser = $this->createMock(IUser::class); - $currentUser->expects($this->once()) + $currentUser->expects($this->exactly(2)) ->method('getUID') ->willReturn('user001'); @@ -253,7 +253,7 @@ class ContactsStoreTest extends TestCase { /** @var IUser|\PHPUnit\Framework\MockObject\MockObject $currentUser */ $currentUser = $this->createMock(IUser::class); - $currentUser->expects($this->once()) + $currentUser->expects($this->exactly(2)) ->method('getUID') ->willReturn('user001'); @@ -332,7 +332,7 @@ class ContactsStoreTest extends TestCase { /** @var IUser|\PHPUnit\Framework\MockObject\MockObject $currentUser */ $currentUser = $this->createMock(IUser::class); - $currentUser->expects($this->once()) + $currentUser->expects($this->exactly(2)) ->method('getUID') ->willReturn('user001'); @@ -411,7 +411,7 @@ class ContactsStoreTest extends TestCase { /** @var IUser|\PHPUnit\Framework\MockObject\MockObject $currentUser */ $currentUser = $this->createMock(IUser::class); - $currentUser->expects($this->once()) + $currentUser->expects($this->exactly(2)) ->method('getUID') ->willReturn('user001'); @@ -469,7 +469,7 @@ class ContactsStoreTest extends TestCase { /** @var IUser|\PHPUnit\Framework\MockObject\MockObject $currentUser */ $currentUser = $this->createMock(IUser::class); - $currentUser->expects($this->once()) + $currentUser->expects($this->exactly(2)) ->method('getUID') ->willReturn('user001'); @@ -555,7 +555,7 @@ class ContactsStoreTest extends TestCase { /** @var IUser|\PHPUnit\Framework\MockObject\MockObject $currentUser */ $currentUser = $this->createMock(IUser::class); - $currentUser->expects($this->once()) + $currentUser->expects($this->exactly(2)) ->method('getUID') ->willReturn('user001'); @@ -624,7 +624,7 @@ class ContactsStoreTest extends TestCase { /** @var IUser|\PHPUnit\Framework\MockObject\MockObject $currentUser */ $currentUser = $this->createMock(IUser::class); - $currentUser->expects($this->once()) + $currentUser->expects($this->exactly(2)) ->method('getUID') ->willReturn('user001'); @@ -963,9 +963,8 @@ class ContactsStoreTest extends TestCase { 'isLocalSystemBook' => false ], ]); - $user->expects($this->once()) - ->method('getUID') - ->willReturn('user123'); + $user->expects($this->never()) + ->method('getUID'); $entry = $this->contactsStore->findOne($user, 0, 'a567'); -- cgit v1.2.3