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: AndroidConfigTest.php
Close
<?php declare(strict_types=1); namespace Kreait\Firebase\Tests\Unit\Messaging; use Kreait\Firebase\Messaging\AndroidConfig; use Kreait\Firebase\Tests\UnitTestCase; /** * @internal */ final class AndroidConfigTest extends UnitTestCase { public function testItIsEmptyWhenItIsEmpty(): void { $this->assertSame('[]', \json_encode(AndroidConfig::new())); } public function testItHasADefaultSound(): void { $expected = [ 'notification' => [ 'sound' => 'default', ], ]; $this->assertJsonStringEqualsJsonString( \json_encode($expected), \json_encode(AndroidConfig::new()->withDefaultSound()) ); } public function testItCanHaveAPriority(): void { $config = AndroidConfig::new()->withNormalPriority(); $this->assertSame('normal', $config->jsonSerialize()['priority']); $config = AndroidConfig::new()->withHighPriority(); $this->assertSame('high', $config->jsonSerialize()['priority']); } /** * @dataProvider validDataProvider * * @param array<string, array<string, mixed>> $data */ public function testItCanBeCreatedFromAnArray(array $data): void { $config = AndroidConfig::fromArray($data); $this->assertEquals($data, $config->jsonSerialize()); } /** * @return array<string, array<int, array<string, mixed>>> */ public function validDataProvider(): array { return [ 'full_config' => [[ // https://firebase.google.com/docs/cloud-messaging/admin/send-messages#android_specific_fields 'ttl' => '3600s', 'priority' => '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' => 'stock_ticker_update', 'color' => '#f45342', 'sound' => 'default', ], ]], ]; } }