1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Test\FlexiPeeHP; |
4
|
|
|
|
5
|
|
|
use FlexiPeeHP\FlexiBee; |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* Generated by PHPUnit_SkeletonGenerator on 2016-05-04 at 10:08:36. |
9
|
|
|
*/ |
10
|
|
|
class FlexiBeeTest extends \Test\Ease\BrickTest |
11
|
|
|
{ |
12
|
|
|
/** |
13
|
|
|
* @var FlexiBee |
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 FlexiBee; |
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
|
|
|
/** |
36
|
|
|
* @covers FlexiPeeHP\FlexiBee::setAgenda |
37
|
|
|
*/ |
38
|
|
|
public function testSetAgenda() |
39
|
|
|
{ |
40
|
|
|
$this->object->setAgenda('nastaveni'); |
41
|
|
|
$this->assertEquals('nastaveni', $this->object->agenda); |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* @covers FlexiPeeHP\FlexiBee::object2array |
46
|
|
|
*/ |
47
|
|
|
public function testObject2array() |
48
|
|
|
{ |
49
|
|
|
$this->assertEquals([], $this->object->object2array(new \stdClass())); |
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* @covers FlexiPeeHP\FlexiBee::performRequest |
54
|
|
|
*/ |
55
|
|
|
public function testPerformRequest() |
56
|
|
|
{ |
57
|
|
|
|
58
|
|
|
if (!is_null($this->object->agenda) && $this->object->agenda != 'test') { |
59
|
|
|
$json = $this->object->performRequest($this->object->agenda.'.json'); |
60
|
|
|
|
61
|
|
|
$this->assertArrayHasKey($json, 'success'); |
62
|
|
|
} else { |
63
|
|
|
$this->markTestSkipped('Agenda not set'); |
64
|
|
|
} |
65
|
|
|
} |
66
|
|
|
|
67
|
|
|
/** |
68
|
|
|
* @covers FlexiPeeHP\FlexiBee::getLastImportId |
69
|
|
|
* @todo Implement testGetLastImportId(). |
70
|
|
|
*/ |
71
|
|
|
public function testGetLastImportId() |
72
|
|
|
{ |
73
|
|
|
// Remove the following lines when you implement this test. |
74
|
|
|
$this->markTestIncomplete( |
75
|
|
|
'This test has not been implemented yet.' |
76
|
|
|
); |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* @covers FlexiPeeHP\FlexiBee::xml2array |
81
|
|
|
* @todo Implement testXml2array(). |
82
|
|
|
*/ |
83
|
|
|
public function testXml2array() |
84
|
|
|
{ |
85
|
|
|
// Remove the following lines when you implement this test. |
86
|
|
|
$this->markTestIncomplete( |
87
|
|
|
'This test has not been implemented yet.' |
88
|
|
|
); |
89
|
|
|
} |
90
|
|
|
|
91
|
|
|
/** |
92
|
|
|
* @covers FlexiPeeHP\FlexiBee::disconnect |
93
|
|
|
* @todo Implement testDisconnect(). |
94
|
|
|
*/ |
95
|
|
|
public function testDisconnect() |
96
|
|
|
{ |
97
|
|
|
// Remove the following lines when you implement this test. |
98
|
|
|
$this->markTestIncomplete( |
99
|
|
|
'This test has not been implemented yet.' |
100
|
|
|
); |
101
|
|
|
} |
102
|
|
|
|
103
|
|
|
/** |
104
|
|
|
* @covers FlexiPeeHP\FlexiBee::__destruct |
105
|
|
|
* @todo Implement test__destruct(). |
106
|
|
|
*/ |
107
|
|
|
public function test__destruct() |
108
|
|
|
{ |
109
|
|
|
// Remove the following lines when you implement this test. |
110
|
|
|
$this->markTestIncomplete( |
111
|
|
|
'This test has not been implemented yet.' |
112
|
|
|
); |
113
|
|
|
} |
114
|
|
|
|
115
|
|
|
/** |
116
|
|
|
* @covers FlexiPeeHP\FlexiBee::loadFlexiData |
117
|
|
|
* @todo Implement testLoadFlexiData(). |
118
|
|
|
*/ |
119
|
|
|
public function testLoadFlexiData() |
120
|
|
|
{ |
121
|
|
|
// Remove the following lines when you implement this test. |
122
|
|
|
$this->markTestIncomplete( |
123
|
|
|
'This test has not been implemented yet.' |
124
|
|
|
); |
125
|
|
|
} |
126
|
|
|
|
127
|
|
|
/** |
128
|
|
|
* @covers FlexiPeeHP\FlexiBee::getFlexiRow |
129
|
|
|
* @todo Implement testGetFlexiRow(). |
130
|
|
|
*/ |
131
|
|
|
public function testGetFlexiRow() |
132
|
|
|
{ |
133
|
|
|
// Remove the following lines when you implement this test. |
134
|
|
|
$this->markTestIncomplete( |
135
|
|
|
'This test has not been implemented yet.' |
136
|
|
|
); |
137
|
|
|
} |
138
|
|
|
|
139
|
|
|
/** |
140
|
|
|
* @covers FlexiPeeHP\FlexiBee::getFlexiData |
141
|
|
|
* @todo Implement testGetFlexiData(). |
142
|
|
|
*/ |
143
|
|
|
public function testGetFlexiData() |
144
|
|
|
{ |
145
|
|
|
// Remove the following lines when you implement this test. |
146
|
|
|
$this->markTestIncomplete( |
147
|
|
|
'This test has not been implemented yet.' |
148
|
|
|
); |
149
|
|
|
} |
150
|
|
|
|
151
|
|
|
/** |
152
|
|
|
* @covers FlexiPeeHP\FlexiBee::loadFromFlexiBee |
153
|
|
|
* @todo Implement testLoadFromFlexiBee(). |
154
|
|
|
*/ |
155
|
|
|
public function testLoadFromFlexiBee() |
156
|
|
|
{ |
157
|
|
|
// Remove the following lines when you implement this test. |
158
|
|
|
$this->markTestIncomplete( |
159
|
|
|
'This test has not been implemented yet.' |
160
|
|
|
); |
161
|
|
|
} |
162
|
|
|
|
163
|
|
|
/** |
164
|
|
|
* @covers FlexiPeeHP\FlexiBee::saveToFlexiBee |
165
|
|
|
* @todo Implement testSaveToFlexiBee(). |
166
|
|
|
*/ |
167
|
|
|
public function testSaveToFlexiBee() |
168
|
|
|
{ |
169
|
|
|
// Remove the following lines when you implement this test. |
170
|
|
|
$this->markTestIncomplete( |
171
|
|
|
'This test has not been implemented yet.' |
172
|
|
|
); |
173
|
|
|
} |
174
|
|
|
|
175
|
|
|
/** |
176
|
|
|
* @covers FlexiPeeHP\FlexiBee::jsonizeData |
177
|
|
|
*/ |
178
|
|
|
public function testJsonizeData() |
179
|
|
|
{ |
180
|
|
|
$this->assertEquals('{"winstrom":{"@version":"1.0","'.$this->object->agenda.'":{"key":"value"}}}', |
181
|
|
|
$this->object->jsonizeData(['key' => 'value'])); |
182
|
|
|
} |
183
|
|
|
|
184
|
|
|
/** |
185
|
|
|
* @covers FlexiPeeHP\FlexiBee::insertToFlexiBee |
186
|
|
|
* @todo Implement testInsertToFlexiBee(). |
187
|
|
|
*/ |
188
|
|
|
public function testInsertToFlexiBee() |
189
|
|
|
{ |
190
|
|
|
// Remove the following lines when you implement this test. |
191
|
|
|
$this->markTestIncomplete( |
192
|
|
|
'This test has not been implemented yet.' |
193
|
|
|
); |
194
|
|
|
} |
195
|
|
|
|
196
|
|
|
/** |
197
|
|
|
* @covers FlexiPeeHP\FlexiBee::idExists |
198
|
|
|
* @todo Implement testIdExists(). |
199
|
|
|
*/ |
200
|
|
|
public function testIdExists() |
201
|
|
|
{ |
202
|
|
|
// Remove the following lines when you implement this test. |
203
|
|
|
$this->markTestIncomplete( |
204
|
|
|
'This test has not been implemented yet.' |
205
|
|
|
); |
206
|
|
|
} |
207
|
|
|
|
208
|
|
|
/** |
209
|
|
|
* @covers FlexiPeeHP\FlexiBee::recordExists |
210
|
|
|
* @todo Implement testRecordExists(). |
211
|
|
|
*/ |
212
|
|
|
public function testRecordExists() |
213
|
|
|
{ |
214
|
|
|
// Remove the following lines when you implement this test. |
215
|
|
|
$this->markTestIncomplete( |
216
|
|
|
'This test has not been implemented yet.' |
217
|
|
|
); |
218
|
|
|
} |
219
|
|
|
|
220
|
|
|
/** |
221
|
|
|
* @covers FlexiPeeHP\FlexiBee::getColumnsFromFlexibee |
222
|
|
|
* @todo Implement testGetColumnsFromFlexibee(). |
223
|
|
|
*/ |
224
|
|
|
public function testGetColumnsFromFlexibee() |
225
|
|
|
{ |
226
|
|
|
// Remove the following lines when you implement this test. |
227
|
|
|
$this->markTestIncomplete( |
228
|
|
|
'This test has not been implemented yet.' |
229
|
|
|
); |
230
|
|
|
} |
231
|
|
|
|
232
|
|
|
/** |
233
|
|
|
* @covers FlexiPeeHP\FlexiBee::getKod |
234
|
|
|
* @todo Implement testGetKod(). |
235
|
|
|
*/ |
236
|
|
|
public function testGetKod() |
237
|
|
|
{ |
238
|
|
|
// Remove the following lines when you implement this test. |
239
|
|
|
$this->markTestIncomplete( |
240
|
|
|
'This test has not been implemented yet.' |
241
|
|
|
); |
242
|
|
|
} |
243
|
|
|
|
244
|
|
|
/** |
245
|
|
|
* @covers FlexiPeeHP\FlexiBee::searchString |
246
|
|
|
* @todo Implement testSearchString(). |
247
|
|
|
*/ |
248
|
|
|
public function testSearchString() |
249
|
|
|
{ |
250
|
|
|
// Remove the following lines when you implement this test. |
251
|
|
|
$this->markTestIncomplete( |
252
|
|
|
'This test has not been implemented yet.' |
253
|
|
|
); |
254
|
|
|
} |
255
|
|
|
|
256
|
|
|
/** |
257
|
|
|
* @covers FlexiPeeHP\FlexiBee::logResult |
258
|
|
|
* @todo Implement testLogResult(). |
259
|
|
|
*/ |
260
|
|
|
public function testLogResult() |
261
|
|
|
{ |
262
|
|
|
// Remove the following lines when you implement this test. |
263
|
|
|
$this->markTestIncomplete( |
264
|
|
|
'This test has not been implemented yet.' |
265
|
|
|
); |
266
|
|
|
} |
267
|
|
|
|
268
|
|
|
/** |
269
|
|
|
* @covers FlexiPeeHP\FlexiBee::flexiUrl |
270
|
|
|
*/ |
271
|
|
|
public function testFlexiUrl() |
272
|
|
|
{ |
273
|
|
|
$this->assertEquals("a = 1 and b = 'foo'", |
274
|
|
|
$this->object->flexiUrl(['a' => 1, 'b' => 'foo'], 'and')); |
275
|
|
|
$this->assertEquals("a = 1 or b = 'bar'", |
276
|
|
|
$this->object->flexiUrl(['a' => 1, 'b' => 'bar'], 'or')); |
277
|
|
|
} |
278
|
|
|
} |