summaryrefslogtreecommitdiffstats
path: root/tests/lib/Contacts
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@protonmail.com>2021-10-20 10:47:23 +0200
committerJohn Molakvoæ <skjnldsv@protonmail.com>2021-10-20 11:53:45 +0200
commit5e23800a95290f5e4ca4d5eac8fa222b1ca34a34 (patch)
tree0d9e5f1b33f48e3bad48be370d6ba7b8f36fac55 /tests/lib/Contacts
parent873e8e219cb7d9c0651260a3b4f138618a22f31e (diff)
downloadnextcloud-server-5e23800a95290f5e4ca4d5eac8fa222b1ca34a34.tar.gz
nextcloud-server-5e23800a95290f5e4ca4d5eac8fa222b1ca34a34.zip
Do not remove current user on findOne
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'tests/lib/Contacts')
-rw-r--r--tests/lib/Contacts/ContactsMenu/ContactsStoreTest.php27
1 files changed, 13 insertions, 14 deletions
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');