Passed
Push — master ( 0efe7a...946c43 )
by Roberto
01:43
created

WebHookTest::testWebHookGetEvent()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 4
c 0
b 0
f 0
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 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
}