WebhookTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testSimpleMessage() 0 8 2
A testInstance() 0 5 1
1
<?php
2
declare(strict_types=1);
3
4
namespace DiscordWebhook\Test;
5
6
use DiscordWebhook\Webhook;
7
use GuzzleHttp\Client;
8
use GuzzleHttp\Exception\GuzzleException;
9
10
class WebhookTest extends AbstractTestCase
11
{
12
    public function testInstance(): void
13
    {
14
        $client = $this->webhook;
15
16
        $this->assertInstanceOf(Webhook::class, $client);
17
    }
18
19
    public function testSimpleMessage(): void
20
    {
21
        $client = $this->webhook;
22
        $client->setMessage('test');
23
24
        try {
25
            $this->assertTrue($client->send());
26
        } catch (GuzzleException $e) {
0 ignored issues
show
Coding Style Comprehensibility introduced by
Consider adding a comment why this CATCH block is empty.
Loading history...
27
        }
28
    }
29
}
30