diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2021-07-16 10:23:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-16 10:23:26 +0200 |
commit | c855235802a6a01a0ecf93b6685fc8a8633371a5 (patch) | |
tree | 5b97c44354f6b6b3e2bb60d9168084d66a530732 /tests/unit/Service/SocialApiServiceTest.php | |
parent | d7b540c9b5b6db6b0910b1d51e27825e9f81810a (diff) | |
parent | 9641980d28fecc0ec82830a2c2523cc7eb50cb52 (diff) |
Merge pull request #2351 from nextcloud/bugfix/2348
Diffstat (limited to 'tests/unit/Service/SocialApiServiceTest.php')
-rw-r--r-- | tests/unit/Service/SocialApiServiceTest.php | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/tests/unit/Service/SocialApiServiceTest.php b/tests/unit/Service/SocialApiServiceTest.php index 9c2ab925..675f81f6 100644 --- a/tests/unit/Service/SocialApiServiceTest.php +++ b/tests/unit/Service/SocialApiServiceTest.php @@ -237,7 +237,7 @@ class SocialApiServiceTest extends TestCase { 'VERSION' => $contact['VERSION'], 'PHOTO;ENCODING=b;TYPE=' . $imageType . ';VALUE=BINARY' => base64_encode($body) ]; - + $this->socialProvider ->expects($this->once())->method("getSocialConnector")->with($network); $provider->expects($this->once())->method("supportsContact")->with($contact); @@ -306,7 +306,7 @@ class SocialApiServiceTest extends TestCase { 'VERSION' => $contact['VERSION'], 'PHOTO' => "data:".$imageType.";base64," . base64_encode($body) ]; - + $this->socialProvider ->expects($this->once())->method("getSocialConnector")->with($network); $provider->expects($this->once())->method("supportsContact")->with($contact); @@ -442,7 +442,17 @@ class SocialApiServiceTest extends TestCase { $this->setupAddressbooks(); - $result = $this->service->updateAddressbooks('any', 'mrstest'); + if ($syncAllowedByAdmin === 'yes' && $bgSyncEnabledByUser === 'yes') { + $this->socialProvider + ->expects($this->atLeastOnce()) + ->method('getSocialConnectors'); + } + + $this->socialProvider + ->expects($this->never()) + ->method('getSocialConnector'); + + $result = $this->service->updateAddressbooks('mrstest'); $this->assertEquals($expected, $result->getStatus()); @@ -474,7 +484,7 @@ class SocialApiServiceTest extends TestCase { $this->setupAddressbooks(); - $result = $this->service->updateAddressbooks('any', 'msstest'); + $result = $this->service->updateAddressbooks('msstest'); $this->assertEquals(Http::STATUS_PARTIAL_CONTENT, $result->getStatus()); @@ -502,7 +512,7 @@ class SocialApiServiceTest extends TestCase { $this->setupAddressbooks(); - $result = $this->service->updateAddressbooks('any', 'mrstest', 'contacts2', '22222222-2222-2222-2222-222222222222'); + $result = $this->service->updateAddressbooks('mrstest', 'contacts2', '22222222-2222-2222-2222-222222222222'); $this->assertEquals($expected, $result->getStatus()); |