WebHookTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
eloc 10
dl 0
loc 41
c 0
b 0
f 0
ccs 12
cts 12
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testElementIsWebHook() 0 2 1
A testSetCollection() 0 5 1
A setUp() 0 15 1
1
<?php
2
/**
3
 * Copyright (c) 2019 - present
4
 * updown - WebHookTest.php
5
 * author: Roberto Belotti - [email protected]
6
 * web : robertobelotti.com, github.com/biscolab
7
 * Initial version created on: 15/2/2019
8
 * MIT license: https://github.com/biscolab/updown-php/blob/master/LICENSE
9
 */
10
11
namespace Tests\Unit;
12
13
use Biscolab\UpDown\Fields\WebHookFields;
14
use Biscolab\UpDown\Objects\WebHook;
15
use Biscolab\UpDown\Tests\TestCase;
16
use Biscolab\UpDown\Types\WebHooks;
17
18
class WebHookTest extends TestCase
19
{
20
21
    /**
22
     * @var WebHooks
23
     */
24
    protected $web_hooks;
25
26
    /**
27
     * @test
28
     */
29 1
    public function testSetCollection()
30
    {
31
32 1
        $this->assertEquals(1, $this->web_hooks->count());
33 1
        $this->assertInstanceOf(WebHooks::class, $this->web_hooks);
34
35 1
    }
36
37 1
    public function testElementIsWebHook() {
38 1
        $this->assertInstanceOf(WebHook::class, $this->web_hooks->first());
39 1
    }
40
41
    /**
42
     * Setup the test environment.
43
     */
44 2
    protected function setUp()
45
    {
46
47 2
        parent::setUp(); // TODO: Change the autogenerated stub
48
49
        $data = [
50
            [
51
52 2
                WebHookFields::ID  => "5c4f5d31ccc9ac4bb838c0c7",
53 2
                WebHookFields::URL => "http://example.com"
54
55
            ]
56
        ];
57
58 2
        $this->web_hooks = new WebHooks($data);
59
    }
60
}