Completed
Push — master ( c4865f...a2b445 )
by Vítězslav
04:48
created

HooksTest::testGetFlexiData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 12
rs 9.4285

1 Method

Rating   Name   Duplication   Size   Complexity  
A HooksTest::tearDown() 0 3 1
1
<?php
2
3
namespace Test\FlexiPeeHP;
4
5
use FlexiPeeHP\Hooks;
6
use FlexiPeeHP\Changes;
7
8
/**
9
 * Generated by PHPUnit_SkeletonGenerator on 2016-05-24 at 14:37:54.
10
 */
11
class HooksTest extends FlexiBeeRWTest
12
{
13
    /**
14
     * @var Hooks
15
     */
16
    protected $object;
17
18
    /**
19
     * Changes API enabler/disabler
20
     * @var Changes
21
     */
22
    protected $changes;
23
24
    /**
25
     * Sets up the fixture, for example, opens a network connection.
26
     * This method is called before a test is executed.
27
     */
28
    protected function setUp()
29
    {
30
        $this->object = new Hooks;
31
    }
32
33
    /**
34
     * @covers FlexiPeeHP\Hooks::register
35
     */
36
    public function testRegister()
37
    {
38
        $this->changes = new Changes();
39
        $this->changes->enable();
40
        $this->object->setDataValue('skipUrlTest', 'true');
41
        $result        = $this->object->register('http://lms.vyvojar.spoje.net/webhook.php');
42
        $this->assertEmpty($result);
43
        $this->object->register('http://lms.vyvojar.spoje.net/webhook.php');
44
    }
45
46
    /**
47
     * @covers FlexiPeeHP\Hooks::unregister
48
     */
49
    public function testUnregister()
50
    {
51
        $hooks = $this->object->getAllFromFlexibee();
52
        $this->assertTrue($this->object->unregister(current(end($hooks))));
53
    }
54
55
    /**
56
     * Disable ChangesAPI
57
     */
58
    protected function tearDown()
59
    {
60
    }
61
}