-
Notifications
You must be signed in to change notification settings - Fork 68
Expand file tree
/
Copy pathPushyTest.php
More file actions
37 lines (29 loc) · 899 Bytes
/
PushyTest.php
File metadata and controls
37 lines (29 loc) · 899 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
<?php
namespace Tests\E2E;
use Utopia\Messaging\Adapters\Push\Pushy as PushyAdapter;
use Utopia\Messaging\Messages\Push;
class PushyTest extends Base{
public function testSend(): void {
$secretKey = getenv('PUSHY_SECRET_KEY');
$adapter = new PushyAdapter($secretKey);
$to = getenv('PUSHY_SERVER_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->assertEquals(1, $response->success);
$this->assertEquals(0, $response->failure);
}
}