Passed
Branch master (f22fa7)
by Stan
04:08
created

NotifableTelegramChannelTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
dl 0
loc 35
rs 10
eloc 12

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testCanSetAndGetEventUrl() 0 7 1
A testCanSetAndGetChatId() 0 6 1
A testCanSetAndGetMessage() 0 7 1
1
<?php
2
3
namespace Tests\Unit\Notifications\Services\Telegram\Entities;
4
5
use Orchestra\Testbench\TestCase;
6
use Skater4\LaravelSentryNotifications\Notifications\Services\Telegram\Entities\NotifableTelegramChannel;
7
8
class NotifableTelegramChannelTest extends TestCase
9
{
10
    /**
11
     * @return void
12
     */
13
    public function testCanSetAndGetChatId()
14
    {
15
        $chatId = '123456789';
16
        $entity = new NotifableTelegramChannel($chatId);
17
18
        $this->assertEquals($chatId, $entity->getChatId());
19
    }
20
21
    /**
22
     * @return void
23
     */
24
    public function testCanSetAndGetMessage()
25
    {
26
        $message = 'Test Message';
27
        $entity = new NotifableTelegramChannel('123456789');
28
        $entity->setMessage($message);
29
30
        $this->assertEquals($message, $entity->getMessage());
31
    }
32
33
    /**
34
     * @return void
35
     */
36
    public function testCanSetAndGetEventUrl()
37
    {
38
        $eventUrl = 'http://example.com/event';
39
        $entity = new NotifableTelegramChannel('123456789');
40
        $entity->setEventUrl($eventUrl);
41
42
        $this->assertEquals($eventUrl, $entity->getEventUrl());
43
    }
44
}
45