1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Test\FlexiPeeHP; |
4
|
|
|
|
5
|
|
|
use FlexiPeeHP\Changes; |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* Generated by PHPUnit_SkeletonGenerator on 2016-05-24 at 14:37:24. |
9
|
|
|
*/ |
10
|
|
|
class ChangesTest extends FlexiBeeROTest |
11
|
|
|
{ |
12
|
|
|
/** |
13
|
|
|
* @var Changes |
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 Changes(); |
24
|
|
|
} |
25
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* @covers FlexiPeeHP\Changes::enable |
28
|
|
|
*/ |
29
|
|
|
public function testEnable() |
30
|
|
|
{ |
31
|
|
|
$this->object->enable(); |
32
|
|
|
$this->assertTrue($this->object->getStatus()); |
33
|
|
|
} |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* @covers FlexiPeeHP\Changes::performRequest |
37
|
|
|
* @depends testEnable |
38
|
|
|
*/ |
39
|
|
|
public function testPerformRequest() |
40
|
|
|
{ |
41
|
|
|
parent::testPerformRequest(); |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* @covers FlexiPeeHP\Changes::idExists |
46
|
|
|
* @depends testEnable |
47
|
|
|
*/ |
48
|
|
|
public function testIdExists() |
49
|
|
|
{ |
50
|
|
|
$this->markTestSkipped('changes does not return id column'); |
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* @covers FlexiPeeHP\Changes::getFlexiData |
55
|
|
|
* @depends testEnable |
56
|
|
|
*/ |
57
|
|
|
public function testGetFlexiData() |
58
|
|
|
{ |
59
|
|
|
/** |
60
|
|
|
* Make Some Changes First ... |
61
|
|
|
*/ |
62
|
|
|
$address = new \FlexiPeeHP\Adresar(); |
63
|
|
|
$address->setDataValue('nazev', \Ease\Sand::randomString()); |
64
|
|
|
$address->setDataValue('poznam', 'Unit Test Random Record'); |
65
|
|
|
$address->insertToFlexiBee(); |
66
|
|
|
|
67
|
|
|
$flexidata = $this->object->getFlexiData(); |
68
|
|
|
|
69
|
|
|
if (isset($flexidata['message']) && ($flexidata['message'] == 'Changelog is not enabled')) { |
70
|
|
|
$this->markTestSkipped('Changelog is not enabled'); |
71
|
|
|
} else { |
72
|
|
|
if (count($flexidata)) { |
73
|
|
|
$this->assertArrayHasKey(0, $flexidata); |
74
|
|
|
} else { |
75
|
|
|
$this->markTestSkipped('Changelog is empty ?'); |
76
|
|
|
} |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
$address->deleteFromFlexiBee(); |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
/** |
83
|
|
|
* @covers FlexiPeeHP\Changes::recordExists |
84
|
|
|
*/ |
85
|
|
|
public function testRecordExists() |
86
|
|
|
{ |
87
|
|
|
$this->assertNull($this->object->recordExists()); |
88
|
|
|
} |
89
|
|
|
|
90
|
|
|
/** |
91
|
|
|
* @covers FlexiPeeHP\Changes::disable |
92
|
|
|
*/ |
93
|
|
|
public function testDisable() |
94
|
|
|
{ |
95
|
|
|
$this->object->disable(); |
96
|
|
|
$this->assertFalse($this->object->getStatus()); |
97
|
|
|
} |
98
|
|
|
|
99
|
|
|
/** |
100
|
|
|
* @covers FlexiPeeHP\Changes::getStatus |
101
|
|
|
*/ |
102
|
|
|
public function testGetStatus() |
103
|
|
|
{ |
104
|
|
|
$status = $this->object->getStatus(); |
105
|
|
|
$this->assertInternalType('boolean', $status); |
106
|
|
|
} |
107
|
|
|
|
108
|
|
|
/** |
109
|
|
|
* Tears down the fixture, for example, closes a network connection. |
110
|
|
|
* This method is called after a test is executed. |
111
|
|
|
*/ |
112
|
|
|
protected function tearDown() |
113
|
|
|
{ |
114
|
|
|
|
115
|
|
|
} |
116
|
|
|
} |
117
|
|
|
|