From 1f2e3c9a4fc4ec2618085f1d4a4d173013ecff26 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 5 Aug 2022 08:52:08 +0200 Subject: Adjust coding style Signed-off-by: Joas Schilling --- tests/unit/Service/Social/DiasporaProviderTest.php | 34 +++++++++++----------- tests/unit/Service/Social/FacebookProviderTest.php | 26 ++++++++--------- tests/unit/Service/Social/GravatarProviderTest.php | 8 ++--- tests/unit/Service/Social/TumblrProviderTest.php | 18 ++++++------ tests/unit/Service/Social/TwitterProviderTest.php | 28 +++++++++--------- tests/unit/Service/Social/XingProviderTest.php | 6 ++-- 6 files changed, 60 insertions(+), 60 deletions(-) (limited to 'tests') diff --git a/tests/unit/Service/Social/DiasporaProviderTest.php b/tests/unit/Service/Social/DiasporaProviderTest.php index e4b066c1..07e65d06 100644 --- a/tests/unit/Service/Social/DiasporaProviderTest.php +++ b/tests/unit/Service/Social/DiasporaProviderTest.php @@ -60,15 +60,15 @@ class DiasporaProviderTest extends TestCase { public function dataProviderSupportsContact() { $contactWithSocial = [ 'X-SOCIALPROFILE' => [ - ["value" => "one", "type" => "diaspora"], - ["value" => "two", "type" => "diaspora"] + ['value' => 'one', 'type' => 'diaspora'], + ['value' => 'two', 'type' => 'diaspora'] ] ]; $contactWithoutSocial = [ 'X-SOCIALPROFILE' => [ - ["value" => "one", "type" => "social2"], - ["value" => "two", "type" => "social1"] + ['value' => 'one', 'type' => 'social2'], + ['value' => 'two', 'type' => 'social1'] ] ]; @@ -89,25 +89,25 @@ class DiasporaProviderTest extends TestCase { public function dataProviderGetImageUrls() { $contactWithSocial = [ 'X-SOCIALPROFILE' => [ - ["value" => "one@two", "type" => "diaspora"], - ["value" => "two@three", "type" => "diaspora"] + ['value' => 'one@two', 'type' => 'diaspora'], + ['value' => 'two@three', 'type' => 'diaspora'] ] ]; $contactWithSocialUrls = [ - "https://two/public/one.atom", - "https://three/public/two.atom" + 'https://two/public/one.atom', + 'https://three/public/two.atom' ]; $contactWithSocialHtml = array_map(function ($url) { - return "".$url."-small-avatar.jpg"; + return ''.$url.'-small-avatar.jpg'; }, $contactWithSocialUrls); $contactWithSocialImg = array_map(function ($url) { - return $url."-large-avatar.jpg"; + return $url.'-large-avatar.jpg'; }, $contactWithSocialUrls); $contactWithoutSocial = [ 'X-SOCIALPROFILE' => [ - ["value" => "one", "type" => "social2"], - ["value" => "two", "type" => "social1"] + ['value' => 'one', 'type' => 'social2'], + ['value' => 'two', 'type' => 'social1'] ] ]; $contactWithoutSocialUrls = []; @@ -157,14 +157,14 @@ class DiasporaProviderTest extends TestCase { public function testGetImageUrlLoop() { $contact = [ 'X-SOCIALPROFILE' => [ - ["value" => "one@two", "type" => "diaspora"], + ['value' => 'one@two', 'type' => 'diaspora'], ] ]; - $url1 = "https://two/public/one.atom"; - $url2 = "https://four/public/three.atom"; + $url1 = 'https://two/public/one.atom'; + $url2 = 'https://four/public/three.atom'; $html1 = ''; - $html2 = "".$url2."-small-avatar.jpg"; - $img = $url2."-large-avatar.jpg"; + $html2 = ''.$url2.'-small-avatar.jpg'; + $img = $url2.'-large-avatar.jpg'; $this->response ->method('getBody') diff --git a/tests/unit/Service/Social/FacebookProviderTest.php b/tests/unit/Service/Social/FacebookProviderTest.php index b2e3d8e0..a386543c 100644 --- a/tests/unit/Service/Social/FacebookProviderTest.php +++ b/tests/unit/Service/Social/FacebookProviderTest.php @@ -60,15 +60,15 @@ class FacebookProviderTest extends TestCase { public function dataProviderSupportsContact() { $contactWithSocial = [ 'X-SOCIALPROFILE' => [ - ["value" => "123124123", "type" => "facebook"], - ["value" => "23426523423", "type" => "facebook"] + ['value' => '123124123', 'type' => 'facebook'], + ['value' => '23426523423', 'type' => 'facebook'] ] ]; $contactWithoutSocial = [ 'X-SOCIALPROFILE' => [ - ["value" => "one", "type" => "social2"], - ["value" => "two", "type" => "social1"] + ['value' => 'one', 'type' => 'social2'], + ['value' => 'two', 'type' => 'social1'] ] ]; @@ -89,19 +89,19 @@ class FacebookProviderTest extends TestCase { public function dataProviderGetImageUrls() { $contactWithSocial = [ 'X-SOCIALPROFILE' => [ - ["value" => "123456", "type" => "facebook"], - ["value" => "7891011", "type" => "facebook"] + ['value' => '123456', 'type' => 'facebook'], + ['value' => '7891011', 'type' => 'facebook'] ] ]; $contactWithSocialUrls = [ - "https://graph.facebook.com/123456/picture?width=720", - "https://graph.facebook.com/7891011/picture?width=720", + 'https://graph.facebook.com/123456/picture?width=720', + 'https://graph.facebook.com/7891011/picture?width=720', ]; $contactWithoutSocial = [ 'X-SOCIALPROFILE' => [ - ["value" => "one", "type" => "social2"], - ["value" => "two", "type" => "social1"] + ['value' => 'one', 'type' => 'social2'], + ['value' => 'two', 'type' => 'social1'] ] ]; $contactWithoutSocialUrls = []; @@ -129,11 +129,11 @@ class FacebookProviderTest extends TestCase { public function testGetImageUrlLookup() { $contact = [ 'X-SOCIALPROFILE' => [ - ["value" => "username1", "type" => "facebook"], + ['value' => 'username1', 'type' => 'facebook'], ] ]; - $url1 = "https://facebook.com/username1"; - $url2 = "https://graph.facebook.com/1234567/picture?width=720"; + $url1 = 'https://facebook.com/username1'; + $url2 = 'https://graph.facebook.com/1234567/picture?width=720'; $html1 = '"entity_id":"1234567"'; $this->response diff --git a/tests/unit/Service/Social/GravatarProviderTest.php b/tests/unit/Service/Social/GravatarProviderTest.php index 8de4f565..32159fdf 100644 --- a/tests/unit/Service/Social/GravatarProviderTest.php +++ b/tests/unit/Service/Social/GravatarProviderTest.php @@ -38,11 +38,11 @@ class GravatarProviderTest extends TestCase { public function dataProviderSupportsContact() { $contactWithEmail = [ - 'EMAIL' => [["value" => "one"], ["value" => "two"]] + 'EMAIL' => [['value' => 'one'], ['value' => 'two']] ]; $contactWithoutEmail = [ - 'PHONE' => [["value" => "one"], ["value" => "two"]] + 'PHONE' => [['value' => 'one'], ["value" => "two"]] ]; return [ @@ -67,9 +67,9 @@ class GravatarProviderTest extends TestCase { $contactWithoutEmail = [ 'PHONE' => [["value" => "one"], ["value" => "two"]] ]; - + $urls = []; - + foreach ($contactWithEmail['EMAIL'] as $email) { $hash = md5(strtolower(trim($email['value']))); $recipe = 'https://www.gravatar.com/avatar/{hash}?s=720&d=404'; diff --git a/tests/unit/Service/Social/TumblrProviderTest.php b/tests/unit/Service/Social/TumblrProviderTest.php index 79e1c931..c9997561 100644 --- a/tests/unit/Service/Social/TumblrProviderTest.php +++ b/tests/unit/Service/Social/TumblrProviderTest.php @@ -39,15 +39,15 @@ class TumblrProviderTest extends TestCase { public function dataProviderSupportsContact() { $contactWithSocial = [ 'X-SOCIALPROFILE' => [ - ["value" => "username1", "type" => "tumblr"], - ["value" => "username2", "type" => "tumblr"] + ['value' => 'username1', 'type' => 'tumblr'], + ['value' => 'username2', 'type' => 'tumblr'] ] ]; $contactWithoutSocial = [ 'X-SOCIALPROFILE' => [ - ["value" => "one", "type" => "social2"], - ["value" => "two", "type" => "social1"] + ['value' => 'one', 'type' => 'social2'], + ['value' => 'two', 'type' => 'social1'] ] ]; @@ -68,20 +68,20 @@ class TumblrProviderTest extends TestCase { public function dataProviderGetImageUrls() { $contactWithSocial = [ 'X-SOCIALPROFILE' => [ - ["value" => "username1", "type" => "tumblr"], - ["value" => "username2", "type" => "tumblr"] + ['value' => 'username1', 'type' => 'tumblr'], + ['value' => 'username2', 'type' => 'tumblr'] ] ]; $contactWithoutSocial = [ 'X-SOCIALPROFILE' => [ - ["value" => "one", "type" => "social2"], - ["value" => "two", "type" => "social1"] + ['value' => 'one', 'type' => 'social2'], + ['value' => 'two', 'type' => 'social1'] ] ]; foreach ($contactWithSocial['X-SOCIALPROFILE'] as $profile) { - $urls[] = "https://api.tumblr.com/v2/blog/".$profile['value']."/avatar/512"; + $urls[] = 'https://api.tumblr.com/v2/blog/'.$profile['value'].'/avatar/512'; } return [ diff --git a/tests/unit/Service/Social/TwitterProviderTest.php b/tests/unit/Service/Social/TwitterProviderTest.php index 45d527d4..c2902c3c 100644 --- a/tests/unit/Service/Social/TwitterProviderTest.php +++ b/tests/unit/Service/Social/TwitterProviderTest.php @@ -66,15 +66,15 @@ class TwitterProviderTest extends TestCase { public function dataProviderSupportsContact() { $contactWithSocial = [ 'X-SOCIALPROFILE' => [ - ["value" => "username1", "type" => "twitter"], - ["value" => "username2", "type" => "twitter"] + ['value' => 'username1', 'type' => 'twitter'], + ['value' => 'username2', 'type' => 'twitter'] ] ]; $contactWithoutSocial = [ 'X-SOCIALPROFILE' => [ - ["value" => "one", "type" => "social2"], - ["value" => "two", "type" => "social1"] + ['value' => 'one', 'type' => 'social2'], + ['value' => 'two', 'type' => 'social1'] ] ]; @@ -95,27 +95,27 @@ class TwitterProviderTest extends TestCase { public function dataProviderGetImageUrls() { $contactWithSocial = [ 'X-SOCIALPROFILE' => [ - ["value" => "https://twitter.com/username1", "type" => "twitter"], - ["value" => "https://twitter.com/@username2", "type" => "twitter"] + ['value' => 'https://twitter.com/username1', 'type' => 'twitter'], + ['value' => 'https://twitter.com/@username2', 'type' => 'twitter'] ] ]; $contactWithSocialUrls = [ - "https://twitter.com/username1", - "https://twitter.com/username2", + 'https://twitter.com/username1', + 'https://twitter.com/username2', ]; $contactWithSocialHtml = [ '', '', ]; $contactWithSocialImgs = [ - "./profile_images/username1_400x400.jpg", - "./profile_images/username2_400x400.jpg" + './profile_images/username1_400x400.jpg', + './profile_images/username2_400x400.jpg' ]; $contactWithoutSocial = [ 'X-SOCIALPROFILE' => [ - ["value" => "one", "type" => "social2"], - ["value" => "two", "type" => "social1"] + ['value' => 'one', 'type' => 'social2'], + ['value' => 'two', 'type' => 'social1'] ] ]; $contactWithoutSocialUrls = []; @@ -143,10 +143,10 @@ class TwitterProviderTest extends TestCase { */ public function testGetImageUrls($contact, $htmls, $urls, $imgs) { if (count($urls)) { - $this->response->method("getBody")->willReturnOnConsecutiveCalls(...$htmls); + $this->response->method('getBody')->willReturnOnConsecutiveCalls(...$htmls); $this->client ->expects($this->exactly(count($urls))) - ->method("get") + ->method('get') ->withConsecutive(...array_map(function ($a) { return [$a]; }, $urls)) diff --git a/tests/unit/Service/Social/XingProviderTest.php b/tests/unit/Service/Social/XingProviderTest.php index d2ee35ea..e0853257 100644 --- a/tests/unit/Service/Social/XingProviderTest.php +++ b/tests/unit/Service/Social/XingProviderTest.php @@ -60,14 +60,14 @@ class XingProviderTest extends TestCase { public function dataProviderSupportsContact() { $contactWithSocial = [ 'X-SOCIALPROFILE' => [ - ["value" => "username1", "type" => "xing"], - ["value" => "username2", "type" => "xing"] + ['value' => 'username1', 'type' => 'xing'], + ['value' => 'username2', 'type' => 'xing'] ] ]; $contactWithoutSocial = [ 'X-SOCIALPROFILE' => [ - ["value" => "one", "type" => "social2"], + ['value' => 'one', "type" => "social2"], ["value" => "two", "type" => "social1"] ] ]; -- cgit v1.2.3