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: WebPushConfigTest.php
Close
<?php declare(strict_types=1); namespace Kreait\Firebase\Tests\Unit\Messaging; use Kreait\Firebase\Messaging\WebPushConfig; use Kreait\Firebase\Tests\UnitTestCase; /** * @internal */ final class WebPushConfigTest extends UnitTestCase { /** * @dataProvider validDataProvider * * @param array<string, mixed> $data */ public function testCreateFromArray(array $data): void { $config = WebPushConfig::fromArray($data); $this->assertEquals($data, $config->jsonSerialize()); } public function testItCanHaveAPriority(): void { $config = WebPushConfig::new()->withVeryLowUrgency(); $this->assertSame('very-low', $config->jsonSerialize()['headers']['Urgency']); $config = WebPushConfig::new()->withLowUrgency(); $this->assertSame('low', $config->jsonSerialize()['headers']['Urgency']); $config = WebPushConfig::new()->withNormalUrgency(); $this->assertSame('normal', $config->jsonSerialize()['headers']['Urgency']); $config = WebPushConfig::new()->withHighUrgency(); $this->assertSame('high', $config->jsonSerialize()['headers']['Urgency']); } /** * @return array<string, array<string, array<string, mixed>>> */ public function validDataProvider(): array { return [ 'full_config' => [ // https://firebase.google.com/docs/cloud-messaging/admin/send-messages#webpush_specific_fields 'headers' => [ 'Urgency' => 'normal', ], 'notification' => [ '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.', 'icon' => 'https://my-server/icon.png', ], ], ]; } }