|
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(): void |
|
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
|
|
|
} |
|
33
|
|
|
|
|
34
|
|
|
/** |
|
35
|
|
|
* @covers FlexiPeeHP\Changes::performRequest |
|
36
|
|
|
* @depends testEnable |
|
37
|
|
|
*/ |
|
38
|
|
|
public function testPerformRequest() |
|
39
|
|
|
{ |
|
40
|
|
|
parent::testPerformRequest(); |
|
41
|
|
|
} |
|
42
|
|
|
|
|
43
|
|
|
/** |
|
44
|
|
|
* @covers FlexiPeeHP\Changes::idExists |
|
45
|
|
|
* @depends testEnable |
|
46
|
|
|
*/ |
|
47
|
|
|
public function testIdExists() |
|
48
|
|
|
{ |
|
49
|
|
|
$this->object->idExists(); |
|
50
|
|
|
} |
|
51
|
|
|
|
|
52
|
|
|
/** |
|
53
|
|
|
* @covers FlexiPeeHP\Changes::getFlexiData |
|
54
|
|
|
* @depends testEnable |
|
55
|
|
|
*/ |
|
56
|
|
|
public function testGetFlexiData() |
|
57
|
|
|
{ |
|
58
|
|
|
/** |
|
59
|
|
|
* Make Some Changes First ... |
|
60
|
|
|
*/ |
|
61
|
|
|
$address = new \FlexiPeeHP\Adresar(); |
|
62
|
|
|
$address->setDataValue('nazev', \Ease\Sand::randomString()); |
|
63
|
|
|
$address->setDataValue('poznam', 'Unit Test Random Record'); |
|
64
|
|
|
$address->insertToFlexiBee(); |
|
65
|
|
|
|
|
66
|
|
|
$flexidata = $this->object->getFlexiData(); |
|
67
|
|
|
|
|
68
|
|
|
if (isset($flexidata['message']) && ($flexidata['message'] == 'Changelog is not enabled')) { |
|
69
|
|
|
$this->markTestSkipped('Changelog is not enabled'); |
|
|
|
|
|
|
70
|
|
|
} else { |
|
71
|
|
|
if (count($flexidata)) { |
|
72
|
|
|
$this->assertArrayHasKey(0, $flexidata); |
|
|
|
|
|
|
73
|
|
|
} else { |
|
74
|
|
|
$this->markTestSkipped('Changelog is empty ?'); |
|
75
|
|
|
} |
|
76
|
|
|
} |
|
77
|
|
|
|
|
78
|
|
|
$address->deleteFromFlexiBee(); |
|
79
|
|
|
} |
|
80
|
|
|
|
|
81
|
|
|
/** |
|
82
|
|
|
* @covers FlexiPeeHP\Changes::recordExists |
|
83
|
|
|
*/ |
|
84
|
|
|
public function testRecordExists() |
|
85
|
|
|
{ |
|
86
|
|
|
$this->assertNull($this->object->recordExists()); |
|
|
|
|
|
|
87
|
|
|
} |
|
88
|
|
|
|
|
89
|
|
|
/** |
|
90
|
|
|
* @covers FlexiPeeHP\Changes::disable |
|
91
|
|
|
*/ |
|
92
|
|
|
public function testDisable() |
|
93
|
|
|
{ |
|
94
|
|
|
$this->object->disable(); |
|
95
|
|
|
$this->assertFalse($this->object->getStatus()); |
|
|
|
|
|
|
96
|
|
|
} |
|
97
|
|
|
|
|
98
|
|
|
/** |
|
99
|
|
|
* @covers FlexiPeeHP\Changes::getStatus |
|
100
|
|
|
*/ |
|
101
|
|
|
public function testGetStatus() |
|
102
|
|
|
{ |
|
103
|
|
|
$status = $this->object->getStatus(); |
|
104
|
|
|
$this->assertInternalType('boolean', $status); |
|
|
|
|
|
|
105
|
|
|
} |
|
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(): void |
|
113
|
|
|
{ |
|
114
|
|
|
|
|
115
|
|
|
} |
|
116
|
|
|
} |
|
117
|
|
|
|
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.