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

StatusTest::testConstructor()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
cc 1
eloc 6
c 2
b 0
f 1
nc 1
nop 0
dl 0
loc 9
rs 9.6666
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