diff options
author | Thomas Citharel <tcit@tcit.fr> | 2022-04-24 16:48:50 +0200 |
---|---|---|
committer | Thomas Citharel <tcit@tcit.fr> | 2022-04-24 16:59:29 +0200 |
commit | 1b11e81c5b12e0641748e7459fab0246b194be40 (patch) | |
tree | 4e4fa5b5ff8b2d7d07ca8afce9a9fb912a892ea8 /tests/unit/Service/SocialApiServiceTest.php | |
parent | a84d7fa7ce66839a0e44934faf652e8c3a69fc23 (diff) |
Make sure URLs for social avatars of contacts are actual URLs
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
Diffstat (limited to 'tests/unit/Service/SocialApiServiceTest.php')
-rw-r--r-- | tests/unit/Service/SocialApiServiceTest.php | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/unit/Service/SocialApiServiceTest.php b/tests/unit/Service/SocialApiServiceTest.php index 675f81f6..a56cbafc 100644 --- a/tests/unit/Service/SocialApiServiceTest.php +++ b/tests/unit/Service/SocialApiServiceTest.php @@ -44,7 +44,7 @@ use PHPUnit\Framework\MockObject\MockObject; use ChristophWurst\Nextcloud\Testing\TestCase; class SocialApiServiceTest extends TestCase { - private $service; + private SocialApiService $service; /** @var CompositeSocialProvider|MockObject */ private $socialProvider; @@ -63,7 +63,7 @@ class SocialApiServiceTest extends TestCase { /** @var ITimeFactory|MockObject */ private $timeFactory; - public function allSocialProfileProviders() { + public function allSocialProfileProviders(): array { $body = "the body"; $imageType = "jpg"; $contact = [ @@ -72,7 +72,7 @@ class SocialApiServiceTest extends TestCase { ]; $connector = $this->createMock(ISocialProvider::class); $connector->method('supportsContact')->willReturn(true); - $connector->method('getImageUrls')->willReturn(["url1"]); + $connector->method('getImageUrls')->willReturn(["https://https://url1.com/an-url/an-url"]); $connectorNoSupport = $this->createMock(ISocialProvider::class); $connectorNoSupport->method('supportsContact')->willReturn(false); @@ -107,7 +107,7 @@ class SocialApiServiceTest extends TestCase { ]; } - public function updateAddressbookProvider() { + public function updateAddressbookProvider(): array { return [ 'not user enabled' => ['yes', 'no', Http::STATUS_FORBIDDEN], 'not admin allowed' => ['no', 'yes', Http::STATUS_FORBIDDEN], @@ -195,7 +195,7 @@ class SocialApiServiceTest extends TestCase { ]; $provider = $this->createMock(ISocialProvider::class); $provider->method('supportsContact')->willReturn(true); - $provider->method('getImageUrls')->willReturn(["url1"]); + $provider->method('getImageUrls')->willReturn(["https://url1.com/an-url"]); $addressbook = $this->createMock(IAddressBook::class); $addressbook @@ -264,7 +264,7 @@ class SocialApiServiceTest extends TestCase { ]; $provider = $this->createMock(ISocialProvider::class); $provider->method('supportsContact')->willReturn(true); - $provider->method('getImageUrls')->willReturn(["url1"]); + $provider->method('getImageUrls')->willReturn(["https://url1.com/an-url"]); $addressbook = $this->createMock(IAddressBook::class); $addressbook @@ -389,10 +389,10 @@ class SocialApiServiceTest extends TestCase { ]; $providerUrlMap = [ - [$validContact1, ["url1"]], + [$validContact1, ["https://url1.com/an-url"]], [$emptyContact, []], [$invalidContact, []], - [$validContact2, ["url1"]] + [$validContact2, ["https://url1.com/an-url"]] ]; $provider = $this->createMock(ISocialProvider::class); |