-
Notifications
You must be signed in to change notification settings - Fork 68
Expand file tree
/
Copy pathPusherTest.php
More file actions
39 lines (31 loc) · 918 Bytes
/
PusherTest.php
File metadata and controls
39 lines (31 loc) · 918 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
namespace Tests\E2E;
use Utopia\Messaging\Adapters\Push\Pusher as PusherAdapter;
use Utopia\Messaging\Messages\Push;
class PusherTest extends Base
{
public function testSend(): void
{
$instanceId = getenv('PUSHER_INSTANCE_ID');
$secretKey = getenv('PUSHER_SECRET_KEY');
$adapter = new PusherAdapter($instanceId, $secretKey);
$to = getenv('PUSHER_TO');
$message = new Push(
to: [$to],
title: 'TestTitle',
body: 'TestBody',
data: [
'some' => 'metadata',
],
action: null,
sound: 'default',
icon: null,
color: null,
tag: null,
badge: '1'
);
$response = \json_decode($adapter->send($message));
$this->assertNotEmpty($response);
$this->assertIsString($response->publishId);
}
}