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
|
|
|
|