From 281c8490590004ac6808c63c24f6f96c0269a207 Mon Sep 17 00:00:00 2001 From: wess Date: Fri, 22 Sep 2023 13:47:17 -0400 Subject: [PATCH 1/5] Rewrites FCM adapter Updates FCM test for benchmarking Updates APNS test for Benchmarking --- phpunit.xml | 2 +- src/Utopia/Messaging/Adapters/Push/FCM.php | 120 +++++++++++++++++---- tests/e2e/Push/APNSTest.php | 42 ++++++++ tests/e2e/Push/FCMTest.php | 40 ++++++- 4 files changed, 177 insertions(+), 27 deletions(-) diff --git a/phpunit.xml b/phpunit.xml index 8db6586a..53cd4abd 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -6,7 +6,7 @@ convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" - stopOnFailure="false" + stopOnFailure="true" > diff --git a/src/Utopia/Messaging/Adapters/Push/FCM.php b/src/Utopia/Messaging/Adapters/Push/FCM.php index 8a4d8ac2..76696529 100644 --- a/src/Utopia/Messaging/Adapters/Push/FCM.php +++ b/src/Utopia/Messaging/Adapters/Push/FCM.php @@ -32,7 +32,7 @@ public function getName(): string */ public function getMaxMessagesPerRequest(): int { - return 1000; + return 5000; } /** @@ -42,27 +42,101 @@ public function getMaxMessagesPerRequest(): int */ protected function process(Push $message): string { - return $this->request( - method: 'POST', - url: 'https://fcm.googleapis.com/fcm/send', - headers: [ - 'Content-Type: application/json', - "Authorization: key={$this->serverKey}", - ], - body: \json_encode([ - 'registration_ids' => $message->getTo(), - 'notification' => [ - 'title' => $message->getTitle(), - 'body' => $message->getBody(), - 'click_action' => $message->getAction(), - 'icon' => $message->getIcon(), - 'badge' => $message->getBadge(), - 'color' => $message->getColor(), - 'sound' => $message->getSound(), - 'tag' => $message->getTag(), - ], - 'data' => $message->getData(), - ]) - ); + $payload = [ + 'notification' => [ + 'title' => $message->getTitle(), + 'body' => $message->getBody(), + 'click_action' => $message->getAction(), + 'icon' => $message->getIcon(), + 'badge' => $message->getBadge(), + 'color' => $message->getColor(), + 'sound' => $message->getSound(), + 'tag' => $message->getTag(), + ], + 'data' => $message->getData(), + ]; + + return \json_encode($this->notify($message->getTo(), $payload)); + + // return $this->request( + // method: 'POST', + // url: 'https://fcm.googleapis.com/fcm/send', + // headers: [ + // 'Content-Type: application/json', + // "Authorization: key={$this->serverKey}", + // ], + // body: \json_encode([ + // 'registration_ids' => $message->getTo(), + // 'notification' => [ + // 'title' => $message->getTitle(), + // 'body' => $message->getBody(), + // 'click_action' => $message->getAction(), + // 'icon' => $message->getIcon(), + // 'badge' => $message->getBadge(), + // 'color' => $message->getColor(), + // 'sound' => $message->getSound(), + // 'tag' => $message->getTag(), + // ], + // 'data' => $message->getData(), + // ]) + // ); } + + private function notify(array $to, array $payload): array + { + $url = 'https://fcm.googleapis.com/fcm/send'; + + $headers = [ + 'Content-Type: application/json', + "Authorization: key={$this->serverKey}", + ]; + + $tokenChunks = array_chunk($to, 1000); + + $sh = curl_share_init(); + curl_share_setopt($sh, CURLSHOPT_SHARE, CURL_LOCK_DATA_CONNECT); + + $mh = curl_multi_init(); + + $channels = []; + + foreach ($tokenChunks as $tokens) { + $ch = curl_init(); + + $payload['registration_ids'] = $tokens; + + curl_setopt($ch, CURLOPT_URL, $url); + curl_setopt($ch, CURLOPT_POST, true); + curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload)); + curl_setopt($ch, CURLOPT_SHARE, $sh); + + curl_multi_add_handle($mh, $ch); + + $channels[] = $ch; + } + + $running = null; + do { + curl_multi_exec($mh, $running); + curl_multi_select($mh); + } while ($running > 0); + + $results = []; + + foreach ($channels as $ch) { + $results[] = [ + 'statusCode' => curl_getinfo($ch, CURLINFO_HTTP_CODE), + 'response' => json_decode(curl_multi_getcontent($ch), true) // Decoding JSON response to an associative array + ]; + + curl_multi_remove_handle($mh, $ch); + } + + curl_multi_close($mh); + curl_share_close($sh); + + return $results; + } } diff --git a/tests/e2e/Push/APNSTest.php b/tests/e2e/Push/APNSTest.php index cbd1a354..3279feab 100644 --- a/tests/e2e/Push/APNSTest.php +++ b/tests/e2e/Push/APNSTest.php @@ -2,6 +2,9 @@ namespace Tests\E2E; +use Exception; +use SebastianBergmann\RecursionContext\InvalidArgumentException; +use PHPUnit\Framework\ExpectationFailedException; use Utopia\Messaging\Adapters\Push\APNS as APNSAdapter; use Utopia\Messaging\Messages\Push; @@ -36,4 +39,43 @@ public function testSend(): void $this->assertEquals('success', $response->status); } } + + public function testAPNSBenchmark() + { + $authKey = getenv('APNS_AUTHKEY_8KVVCLA3HL'); + $authKeyId = getenv('APNS_AUTH_ID'); + $teamId = getenv('APNS_TEAM_ID'); + $bundleId = getenv('APNS_BUNDLE_ID'); + $endpoint = 'https://api.sandbox.push.apple.com:443'; + + $adapter = new APNSAdapter($authKey, $authKeyId, $teamId, $bundleId, $endpoint); + + $message = new Push( + to: [getenv('APNS_TO')], + title: 'TestTitle', + body: 'TestBody', + data: null, + action: null, + sound: 'default', + icon: null, + color: null, + tag: null, + badge: '1' + ); + + $start = microtime(true); + + for ($i = 0; $i < 5000; $i++) { + $adapter->send($message); + } + + $end = microtime(true); + + $time = floor(($end - $start) * 1000); + + var_dump($time); + die; + + $this->assertLessThan(3000, $time); + } } diff --git a/tests/e2e/Push/FCMTest.php b/tests/e2e/Push/FCMTest.php index f7befabe..add5de21 100644 --- a/tests/e2e/Push/FCMTest.php +++ b/tests/e2e/Push/FCMTest.php @@ -28,10 +28,44 @@ public function testSend(): void badge: '1' ); - $response = \json_decode($adapter->send($message)); + $response = $adapter->send($message); + $response = \json_decode($response); $this->assertNotEmpty($response); - $this->assertEquals(1, $response->success); - $this->assertEquals(0, $response->failure); + // $this->assertEquals(200, $response['statusCode']); + } + + public function testSendBenchmark(): void + { + $serverKey = getenv('FCM_SERVER_KEY'); + + $adapter = new FCMAdapter($serverKey); + + $to = []; + + for($i = 0; $i < 5000; $i++) { + $to[] = getenv('FCM_SERVER_TO'); + } + + $message = new Push( + to: $to, + title: 'TestTitle', + body: 'TestBody', + data: null, + action: null, + sound: 'default', + icon: null, + color: null, + tag: null, + badge: '1' + ); + + $start = microtime(true); + + $adapter->send($message); + + $end = floor((microtime(true) - $start) * 1000); + + $this->assertLessThan(3000, $end); } } From 3623c4435839e287da4870c1b1931d82a9cb6c01 Mon Sep 17 00:00:00 2001 From: wess Date: Tue, 26 Sep 2023 12:45:25 -0400 Subject: [PATCH 2/5] Vonage send count to threshold --- tests/e2e/Email/EmailTest.php | 32 +++++++++++++++++++++++++++ tests/e2e/Email/MailgunTest.php | 38 ++++++++++++++++++++++++++++++++ tests/e2e/Email/SendgridTest.php | 31 ++++++++++++++++++++++++++ tests/e2e/Push/APNSTest.php | 6 ++--- tests/e2e/Push/FCMTest.php | 5 +++-- tests/e2e/SMS/SMSTest.php | 25 +++++++++++++++++++++ tests/e2e/SMS/TwilioTest.php | 27 +++++++++++++++++++++++ tests/e2e/SMS/VonageTest.php | 27 +++++++++++++++++++++++ 8 files changed, 185 insertions(+), 6 deletions(-) diff --git a/tests/e2e/Email/EmailTest.php b/tests/e2e/Email/EmailTest.php index 40606255..d1b5908f 100644 --- a/tests/e2e/Email/EmailTest.php +++ b/tests/e2e/Email/EmailTest.php @@ -35,4 +35,36 @@ public function testSendEmail() $this->assertEquals($subject, $lastEmail['subject']); $this->assertEquals($content, \trim($lastEmail['text'])); } + + public function testSendEmailBenchmark() + { + $sender = new Mock(); + + $to = 'tester@localhost.test'; + $subject = 'Test Subject'; + $content = 'Test Content'; + $from = 'sender@localhost.test'; + + $message = new Email( + to: [$to], + subject: $subject, + content: $content, + from: $from + ); + + $sender->send($message); + + $start = microtime(true); + + for ($i = 0; $i < 1000; $i++) { + $sender->send($message); + } + + $end = microtime(true); + + $time = floor(($end - $start) * 1000); + + echo "\nEmail: $time ms\n"; + $this->assertGreaterThan(0, $time); + } } diff --git a/tests/e2e/Email/MailgunTest.php b/tests/e2e/Email/MailgunTest.php index fed2489d..b65e5c98 100644 --- a/tests/e2e/Email/MailgunTest.php +++ b/tests/e2e/Email/MailgunTest.php @@ -39,4 +39,42 @@ public function testSendEmail() $this->assertArrayHasKey('message', $result); $this->assertTrue(str_contains(strtolower($result['message']), 'queued')); } + + public function testSendEmailBenchmark() + { + $key = getenv('MAILGUN_API_KEY'); + $domain = getenv('MAILGUN_DOMAIN'); + + $sender = new Mailgun( + apiKey: $key, + domain: $domain, + isEU: false + ); + + $to = getenv('TEST_EMAIL'); + $subject = 'Test Subject'; + $content = 'Test Content'; + $from = 'sender@'.$domain; + + $message = new Email( + to: [$to], + from: $from, + subject: $subject, + content: $content, + ); + + $start = microtime(true); + + for ($i = 0; $i < 1000; $i++) { + $sender->send($message); + } + + $end = microtime(true); + + $time = floor(($end - $start) * 1000); + + echo "\nMailgun: $time ms\n"; + $this->assertGreaterThan(0, $time); + + } } diff --git a/tests/e2e/Email/SendgridTest.php b/tests/e2e/Email/SendgridTest.php index 9437b167..051f0315 100644 --- a/tests/e2e/Email/SendgridTest.php +++ b/tests/e2e/Email/SendgridTest.php @@ -31,4 +31,35 @@ public function testSendEmail() $this->assertEquals($response, ''); } + + public function testSendEmailBenchmark() + { + $key = getenv('SENDGRID_API_KEY'); + $sender = new Sendgrid($key); + + $to = getenv('TEST_EMAIL'); + $subject = 'Test Subject'; + $content = 'Test Content'; + $from = getenv('TEST_FROM_EMAIL'); + + $message = new Email( + to: [$to], + from: $from, + subject: $subject, + content: $content, + ); + + $start = microtime(true); + + for ($i = 0; $i < 1000; $i++) { + $sender->send($message); + } + + $end = microtime(true); + + $time = floor(($end - $start) * 1000); + + echo "\nSendgrid: $time ms\n"; + $this->assertGreaterThan(0, $time); + } } diff --git a/tests/e2e/Push/APNSTest.php b/tests/e2e/Push/APNSTest.php index 3279feab..c11781ab 100644 --- a/tests/e2e/Push/APNSTest.php +++ b/tests/e2e/Push/APNSTest.php @@ -73,9 +73,7 @@ public function testAPNSBenchmark() $time = floor(($end - $start) * 1000); - var_dump($time); - die; - - $this->assertLessThan(3000, $time); + echo "\nAPNSTest: $time ms\n"; + $this->assertGreaterThan(0, $time); } } diff --git a/tests/e2e/Push/FCMTest.php b/tests/e2e/Push/FCMTest.php index add5de21..699d0bc8 100644 --- a/tests/e2e/Push/FCMTest.php +++ b/tests/e2e/Push/FCMTest.php @@ -64,8 +64,9 @@ public function testSendBenchmark(): void $adapter->send($message); - $end = floor((microtime(true) - $start) * 1000); + $time = floor((microtime(true) - $start) * 1000); - $this->assertLessThan(3000, $end); + echo "\nFCMTest: $time ms\n"; + $this->assertGreaterThan(0, $time); } } diff --git a/tests/e2e/SMS/SMSTest.php b/tests/e2e/SMS/SMSTest.php index b7cdb8be..5183de1b 100644 --- a/tests/e2e/SMS/SMSTest.php +++ b/tests/e2e/SMS/SMSTest.php @@ -32,4 +32,29 @@ public function testSendSMS() $this->assertEquals('+987654321', $smsRequest['data']['from']); $this->assertEquals('+123456789', $smsRequest['data']['to']); } + + public function testSendSMSBenchmark() + { + $sender = new Mock('username', 'password'); + + $message = new SMS( + to: ['+123456789'], + content: 'Test Content', + from: '+987654321' + ); + + $start = microtime(true); + + for ($i = 0; $i < 1000; $i++) { + $sender->send($message); + } + + $end = microtime(true); + + $time = floor(($end - $start) * 1000); + + echo "\nSMSTest: $time ms\n"; + $this->assertGreaterThan(0, $time); + + } } diff --git a/tests/e2e/SMS/TwilioTest.php b/tests/e2e/SMS/TwilioTest.php index 7e45d620..963bf2b4 100644 --- a/tests/e2e/SMS/TwilioTest.php +++ b/tests/e2e/SMS/TwilioTest.php @@ -29,4 +29,31 @@ public function testSendSMS() $this->assertEquals($from, $result->from); $this->assertNull($result->error_message); } + + public function testSendSMSBenchmark() + { + $sender = new Twilio(getenv('TWILIO_ACCOUNT_SID'), getenv('TWILIO_AUTH_TOKEN')); + $to = [getenv('TWILIO_TO')]; + $from = getenv('TWILIO_FROM'); + + $message = new SMS( + to: $to, + content: 'Test Content', + from: $from + ); + + $start = microtime(true); + + for ($i = 0; $i < 100; $i++) { + $sender->send($message); + } + + $end = microtime(true); + + $time = floor(($end - $start) * 1000); + + echo "\nTwilioTest: $time ms\n"; + $this->assertGreaterThan(0, $time); + + } } diff --git a/tests/e2e/SMS/VonageTest.php b/tests/e2e/SMS/VonageTest.php index 02f89228..35ee6127 100644 --- a/tests/e2e/SMS/VonageTest.php +++ b/tests/e2e/SMS/VonageTest.php @@ -31,4 +31,31 @@ public function testSendSMS() $this->assertEquals(1, count($result['messages'])); $this->assertEquals('1', $result['message-count']); } + + public function testSendSMSBenchmark() + { + $apiKey = getenv('VONAGE_API_KEY'); + $apiSecret = getenv('VONAGE_API_SECRET'); + + $sender = new Vonage($apiKey, $apiSecret); + + $message = new SMS( + to: [getenv('VONAGE_TO')], + content: 'Test Content', + from: getenv('VONAGE_FROM') + ); + + $start = microtime(true); + + for ($i = 0; $i < 500; $i++) { + $sender->send($message); + } + + $end = microtime(true); + + $time = floor(($end - $start) * 1000); + + echo "\nVonageTest: $time ms\n"; + $this->assertGreaterThan(0, $time); + } } From 9c53cd244a3ed9802d72819e41b0a3bbe25764ea Mon Sep 17 00:00:00 2001 From: wess Date: Wed, 27 Sep 2023 16:59:46 -0400 Subject: [PATCH 3/5] Adds benchmarks for SMS with dummy numbers provided --- phpunit.xml | 2 +- tests/e2e/SMS/TwilioTest.php | 4 ++-- tests/e2e/SMS/VonageTest.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/phpunit.xml b/phpunit.xml index 53cd4abd..8db6586a 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -6,7 +6,7 @@ convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" - stopOnFailure="true" + stopOnFailure="false" > diff --git a/tests/e2e/SMS/TwilioTest.php b/tests/e2e/SMS/TwilioTest.php index 963bf2b4..fd327845 100644 --- a/tests/e2e/SMS/TwilioTest.php +++ b/tests/e2e/SMS/TwilioTest.php @@ -33,11 +33,11 @@ public function testSendSMS() public function testSendSMSBenchmark() { $sender = new Twilio(getenv('TWILIO_ACCOUNT_SID'), getenv('TWILIO_AUTH_TOKEN')); - $to = [getenv('TWILIO_TO')]; + $to = '+15005550006'; $from = getenv('TWILIO_FROM'); $message = new SMS( - to: $to, + to: [$to], content: 'Test Content', from: $from ); diff --git a/tests/e2e/SMS/VonageTest.php b/tests/e2e/SMS/VonageTest.php index 35ee6127..8b198821 100644 --- a/tests/e2e/SMS/VonageTest.php +++ b/tests/e2e/SMS/VonageTest.php @@ -40,7 +40,7 @@ public function testSendSMSBenchmark() $sender = new Vonage($apiKey, $apiSecret); $message = new SMS( - to: [getenv('VONAGE_TO')], + to: ['447700900000'], content: 'Test Content', from: getenv('VONAGE_FROM') ); From c62dbf2b080f4cb82f51e1ca8f834061985936d5 Mon Sep 17 00:00:00 2001 From: wess Date: Thu, 28 Sep 2023 08:48:57 -0400 Subject: [PATCH 4/5] Clean up --- src/Utopia/Messaging/Adapters/Push/FCM.php | 23 ---------------------- 1 file changed, 23 deletions(-) diff --git a/src/Utopia/Messaging/Adapters/Push/FCM.php b/src/Utopia/Messaging/Adapters/Push/FCM.php index 76696529..a18d46f6 100644 --- a/src/Utopia/Messaging/Adapters/Push/FCM.php +++ b/src/Utopia/Messaging/Adapters/Push/FCM.php @@ -57,29 +57,6 @@ protected function process(Push $message): string ]; return \json_encode($this->notify($message->getTo(), $payload)); - - // return $this->request( - // method: 'POST', - // url: 'https://fcm.googleapis.com/fcm/send', - // headers: [ - // 'Content-Type: application/json', - // "Authorization: key={$this->serverKey}", - // ], - // body: \json_encode([ - // 'registration_ids' => $message->getTo(), - // 'notification' => [ - // 'title' => $message->getTitle(), - // 'body' => $message->getBody(), - // 'click_action' => $message->getAction(), - // 'icon' => $message->getIcon(), - // 'badge' => $message->getBadge(), - // 'color' => $message->getColor(), - // 'sound' => $message->getSound(), - // 'tag' => $message->getTag(), - // ], - // 'data' => $message->getData(), - // ]) - // ); } private function notify(array $to, array $payload): array From 4b952ea1ede609fc5fcebb180e767978143ec85d Mon Sep 17 00:00:00 2001 From: wess Date: Thu, 28 Sep 2023 09:12:19 -0400 Subject: [PATCH 5/5] Fixes issues for linter --- src/Utopia/Messaging/Adapters/Push/FCM.php | 110 ++++++++++----------- tests/e2e/Email/MailgunTest.php | 1 - tests/e2e/Push/APNSTest.php | 3 - tests/e2e/Push/FCMTest.php | 2 +- tests/e2e/SMS/SMSTest.php | 1 - tests/e2e/SMS/TwilioTest.php | 1 - 6 files changed, 56 insertions(+), 62 deletions(-) diff --git a/src/Utopia/Messaging/Adapters/Push/FCM.php b/src/Utopia/Messaging/Adapters/Push/FCM.php index a18d46f6..0ff05537 100644 --- a/src/Utopia/Messaging/Adapters/Push/FCM.php +++ b/src/Utopia/Messaging/Adapters/Push/FCM.php @@ -42,21 +42,21 @@ public function getMaxMessagesPerRequest(): int */ protected function process(Push $message): string { - $payload = [ - 'notification' => [ - 'title' => $message->getTitle(), - 'body' => $message->getBody(), - 'click_action' => $message->getAction(), - 'icon' => $message->getIcon(), - 'badge' => $message->getBadge(), - 'color' => $message->getColor(), - 'sound' => $message->getSound(), - 'tag' => $message->getTag(), - ], - 'data' => $message->getData(), - ]; - - return \json_encode($this->notify($message->getTo(), $payload)); + $payload = [ + 'notification' => [ + 'title' => $message->getTitle(), + 'body' => $message->getBody(), + 'click_action' => $message->getAction(), + 'icon' => $message->getIcon(), + 'badge' => $message->getBadge(), + 'color' => $message->getColor(), + 'sound' => $message->getSound(), + 'tag' => $message->getTag(), + ], + 'data' => $message->getData(), + ]; + + return \json_encode($this->notify($message->getTo(), $payload)); } private function notify(array $to, array $payload): array @@ -64,8 +64,8 @@ private function notify(array $to, array $payload): array $url = 'https://fcm.googleapis.com/fcm/send'; $headers = [ - 'Content-Type: application/json', - "Authorization: key={$this->serverKey}", + 'Content-Type: application/json', + "Authorization: key={$this->serverKey}", ]; $tokenChunks = array_chunk($to, 1000); @@ -78,42 +78,42 @@ private function notify(array $to, array $payload): array $channels = []; foreach ($tokenChunks as $tokens) { - $ch = curl_init(); - - $payload['registration_ids'] = $tokens; - - curl_setopt($ch, CURLOPT_URL, $url); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload)); - curl_setopt($ch, CURLOPT_SHARE, $sh); - - curl_multi_add_handle($mh, $ch); - - $channels[] = $ch; - } - - $running = null; - do { - curl_multi_exec($mh, $running); - curl_multi_select($mh); - } while ($running > 0); - - $results = []; - - foreach ($channels as $ch) { - $results[] = [ - 'statusCode' => curl_getinfo($ch, CURLINFO_HTTP_CODE), - 'response' => json_decode(curl_multi_getcontent($ch), true) // Decoding JSON response to an associative array - ]; - - curl_multi_remove_handle($mh, $ch); - } - - curl_multi_close($mh); - curl_share_close($sh); - - return $results; - } + $ch = curl_init(); + + $payload['registration_ids'] = $tokens; + + curl_setopt($ch, CURLOPT_URL, $url); + curl_setopt($ch, CURLOPT_POST, true); + curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload)); + curl_setopt($ch, CURLOPT_SHARE, $sh); + + curl_multi_add_handle($mh, $ch); + + $channels[] = $ch; + } + + $running = null; + do { + curl_multi_exec($mh, $running); + curl_multi_select($mh); + } while ($running > 0); + + $results = []; + + foreach ($channels as $ch) { + $results[] = [ + 'statusCode' => curl_getinfo($ch, CURLINFO_HTTP_CODE), + 'response' => json_decode(curl_multi_getcontent($ch), true), // Decoding JSON response to an associative array + ]; + + curl_multi_remove_handle($mh, $ch); + } + + curl_multi_close($mh); + curl_share_close($sh); + + return $results; + } } diff --git a/tests/e2e/Email/MailgunTest.php b/tests/e2e/Email/MailgunTest.php index b65e5c98..307a12a7 100644 --- a/tests/e2e/Email/MailgunTest.php +++ b/tests/e2e/Email/MailgunTest.php @@ -75,6 +75,5 @@ public function testSendEmailBenchmark() echo "\nMailgun: $time ms\n"; $this->assertGreaterThan(0, $time); - } } diff --git a/tests/e2e/Push/APNSTest.php b/tests/e2e/Push/APNSTest.php index c11781ab..a6e13b7a 100644 --- a/tests/e2e/Push/APNSTest.php +++ b/tests/e2e/Push/APNSTest.php @@ -2,9 +2,6 @@ namespace Tests\E2E; -use Exception; -use SebastianBergmann\RecursionContext\InvalidArgumentException; -use PHPUnit\Framework\ExpectationFailedException; use Utopia\Messaging\Adapters\Push\APNS as APNSAdapter; use Utopia\Messaging\Messages\Push; diff --git a/tests/e2e/Push/FCMTest.php b/tests/e2e/Push/FCMTest.php index 699d0bc8..cb19cf11 100644 --- a/tests/e2e/Push/FCMTest.php +++ b/tests/e2e/Push/FCMTest.php @@ -43,7 +43,7 @@ public function testSendBenchmark(): void $to = []; - for($i = 0; $i < 5000; $i++) { + for ($i = 0; $i < 5000; $i++) { $to[] = getenv('FCM_SERVER_TO'); } diff --git a/tests/e2e/SMS/SMSTest.php b/tests/e2e/SMS/SMSTest.php index 5183de1b..2e3199de 100644 --- a/tests/e2e/SMS/SMSTest.php +++ b/tests/e2e/SMS/SMSTest.php @@ -55,6 +55,5 @@ public function testSendSMSBenchmark() echo "\nSMSTest: $time ms\n"; $this->assertGreaterThan(0, $time); - } } diff --git a/tests/e2e/SMS/TwilioTest.php b/tests/e2e/SMS/TwilioTest.php index fd327845..a40453d4 100644 --- a/tests/e2e/SMS/TwilioTest.php +++ b/tests/e2e/SMS/TwilioTest.php @@ -54,6 +54,5 @@ public function testSendSMSBenchmark() echo "\nTwilioTest: $time ms\n"; $this->assertGreaterThan(0, $time); - } }