Completed
Push — master ( 828492...04cf61 )
by Vítězslav
10:06
created

StatusTest   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 62
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 3
Bugs 0 Features 1
Metric Value
c 3
b 0
f 1
dl 0
loc 62
rs 10
wmc 6
lcom 1
cbo 3

6 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 4 1
A tearDown() 0 4 1
A testConstructor() 0 9 1
A testGetFlexiData() 0 4 1
A testGetData() 0 4 1
A testUnifyResponseFormat() 0 7 1
1
<?php
2
3
namespace Test\FlexiPeeHP;
4
5
use \FlexiPeeHP\Status;
6
7
/**
8
 * Generated by PHPUnit_SkeletonGenerator on 2016-10-27 at 23:57:50.
9
 */
10
class StatusTest extends FlexiBeeROTest
11
{
12
    /**
13
     * @var Status
14
     */
15
    protected $object;
16
17
    /**
18
     * Sets up the fixture, for example, opens a network connection.
19
     * This method is called before a test is executed.
20
     */
21
    protected function setUp()
22
    {
23
        $this->object = new \FlexiPeeHP\Status();
24
    }
25
26
    /**
27
     * Tears down the fixture, for example, closes a network connection.
28
     * This method is called after a test is executed.
29
     */
30
    protected function tearDown()
31
    {
32
33
    }
34
35
    public function testConstructor()
36
    {
37
        $classname = get_class($this->object);
38
        // Get mock, without the constructor being called
39
        $mock = $this->getMockBuilder($classname)
40
            ->disableOriginalConstructor()
41
            ->getMockForAbstractClass();
42
        $mock->__construct();
43
    }
44
45
    /**
46
     * @covers FlexiPeeHP\Status::getFlexiData
47
     */
48
    public function testGetFlexiData()
49
    {
50
        $this->assertArrayHasKey('version', $this->object->getFlexiData());
51
    }
52
53
    /**
54
     * @covers FlexiPeeHP\Status::getData
55
     */
56
    public function testGetData()
57
    {
58
        $this->assertArrayHasKey('licenseName', $this->object->getData());
59
    }
60
61
    /**
62
     * @covers FlexiPeeHP\Status::unifyResponseFormat
63
     */
64
    public function testUnifyResponseFormat()
65
    {
66
        $this->assertEquals(['success' => 'false'],
67
            $this->object->unifyResponseFormat(['success' => 'false']));
68
        $this->assertEquals(['version' => 'ok'],
69
            $this->object->unifyResponseFormat(['status' => ['version' => 'ok']]));
70
    }
71
}
72