OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
firebase
/
vendor
/
kreait
/
firebase-php
/
tests
/
Unit
/
Messaging
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
08/12/2024 10:35:44 AM
rwxr-xr-x
📄
AndroidConfigTest.php
2.15 KB
08/12/2024 10:35:42 AM
rw-r--r--
📄
ApiClientTest.php
3.47 KB
08/12/2024 10:35:42 AM
rw-r--r--
📄
ApnsConfigTest.php
2.67 KB
08/12/2024 10:35:42 AM
rw-r--r--
📄
CloudMessageTest.php
5.79 KB
08/12/2024 10:35:42 AM
rw-r--r--
📄
ConditionTest.php
1.79 KB
08/12/2024 10:35:42 AM
rw-r--r--
📄
MessageDataTest.php
2.81 KB
08/12/2024 10:35:42 AM
rw-r--r--
📄
MessageTargetTest.php
486 bytes
08/12/2024 10:35:42 AM
rw-r--r--
📄
NotificationTest.php
2.27 KB
08/12/2024 10:35:42 AM
rw-r--r--
📄
RegistrationTokenTest.php
805 bytes
08/12/2024 10:35:42 AM
rw-r--r--
📄
RegistrationTokensTest.php
1.96 KB
08/12/2024 10:35:42 AM
rw-r--r--
📄
TopicTest.php
1.32 KB
08/12/2024 10:35:42 AM
rw-r--r--
📄
WebPushConfigTest.php
1.89 KB
08/12/2024 10:35:42 AM
rw-r--r--
Editing: ApnsConfigTest.php
Close
<?php declare(strict_types=1); namespace Kreait\Firebase\Tests\Unit\Messaging; use Kreait\Firebase\Messaging\ApnsConfig; use Kreait\Firebase\Tests\UnitTestCase; /** * @internal */ final class ApnsConfigTest extends UnitTestCase { public function testItIsEmptyWhenItIsEmpty(): void { $this->assertSame('[]', \json_encode(ApnsConfig::new())); } public function testItHasADefaultSound(): void { $expected = [ 'payload' => [ 'aps' => [ 'sound' => 'default', ], ], ]; $this->assertJsonStringEqualsJsonString( \json_encode($expected), \json_encode(ApnsConfig::new()->withDefaultSound()) ); } public function testItHasABadge(): void { $expected = [ 'payload' => [ 'aps' => [ 'badge' => 123, ], ], ]; $this->assertJsonStringEqualsJsonString( \json_encode($expected), \json_encode(ApnsConfig::new()->withBadge(123)) ); } /** * @dataProvider validDataProvider * * @param array<string, mixed> $data */ public function testItCanBeCreatedFromAnArray(array $data): void { $config = ApnsConfig::fromArray($data); $this->assertEquals($data, $config->jsonSerialize()); } public function testItCanHaveAPriority(): void { $config = ApnsConfig::new()->withImmediatePriority(); $this->assertSame('10', $config->jsonSerialize()['headers']['apns-priority']); $config = ApnsConfig::new()->withPowerConservingPriority(); $this->assertSame('5', $config->jsonSerialize()['headers']['apns-priority']); } /** * @return array<string, array<int, array<string, mixed>>> */ public function validDataProvider() { return [ 'full_config' => [[ // https://firebase.google.com/docs/cloud-messaging/admin/send-messages#apns_specific_fields 'headers' => [ 'apns-priority' => '10', ], 'payload' => [ 'aps' => [ 'alert' => [ 'title' => '$GOOG up 1.43% on the day', 'body' => '$GOOG gained 11.80 points to close at 835.67, up 1.43% on the day.', ], 'badge' => 42, 'sound' => 'default', ], ], ]], ]; } }