Conditions | 1 |
Paths | 1 |
Total Lines | 14 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | public function testTelegramNotificationDataStructure() |
||
15 | { |
||
16 | $notification = new TelegramSentryNotification(); |
||
17 | |||
18 | $notifiable = $this->createMock(NotifableTelegramChannel::class); |
||
19 | $notifiable->method('getChatId')->willReturn('123456789'); |
||
20 | $notifiable->method('getMessage')->willReturn('Error: wtf?'); |
||
21 | |||
22 | $data = $notification->toTelegram($notifiable); |
||
23 | |||
24 | $this->assertNotNull($data->getPayloadValue('text')); |
||
25 | $this->assertNotNull($data->getPayloadValue('chat_id')); |
||
26 | $this->assertEquals('123456789', $data->getPayloadValue('chat_id')); |
||
27 | $this->assertStringContainsString('Error', $data->getPayloadValue('text')); |
||
|
|||
28 | } |
||
30 |