1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Test\FlexiPeeHP; |
4
|
|
|
|
5
|
|
|
use FlexiPeeHP\Stitek; |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* Generated by PHPUnit_SkeletonGenerator on 2016-04-27 at 17:32:11. |
9
|
|
|
*/ |
10
|
|
|
class StitekTest extends FlexiBeeRWTest |
11
|
|
|
{ |
12
|
|
|
/** |
13
|
|
|
* @var Stitek |
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 Stitek; |
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(): void |
31
|
|
|
{ |
32
|
|
|
|
33
|
|
|
} |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* @covers FlexiPeeHP\Stitek::getLabels |
37
|
|
|
*/ |
38
|
|
|
public function testGetLabels() |
39
|
|
|
{ |
40
|
|
|
$this->object->getLabels(new \FlexiPeeHP\Adresar()); |
|
|
|
|
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @covers FlexiPeeHP\Stitek::listToArray |
45
|
|
|
*/ |
46
|
|
|
public function testListToArray() |
47
|
|
|
{ |
48
|
|
|
$this->assertEquals(['A' => 'A', 'B' => 'B'], Stitek::listToArray('A,B')); |
|
|
|
|
49
|
|
|
} |
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* @covers FlexiPeeHP\Stitek::getAvailbleLabels |
53
|
|
|
*/ |
54
|
|
|
public function testGetAvailbleLabels() |
55
|
|
|
{ |
56
|
|
|
$labels = \FlexiPeeHP\Stitek::getAvailbleLabels(new \FlexiPeeHP\FakturaVydana()); |
57
|
|
|
$this->assertTrue(is_array($labels) && count($labels)); |
|
|
|
|
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
/** |
61
|
|
|
* @covers FlexiPeeHP\Stitek::setLabel |
62
|
|
|
* @todo Implement testSetLabel(). |
63
|
|
|
*/ |
64
|
|
|
public function testSetLabel() |
65
|
|
|
{ |
66
|
|
|
// Remove the following lines when you implement this test. |
67
|
|
|
$this->markTestIncomplete( |
|
|
|
|
68
|
|
|
'This test has not been implemented yet.' |
69
|
|
|
); |
70
|
|
|
} |
71
|
|
|
|
72
|
|
|
/** |
73
|
|
|
* @covers FlexiPeeHP\Stitek::unsetLabel |
74
|
|
|
* @todo Implement testUnsetLabel(). |
75
|
|
|
*/ |
76
|
|
|
public function testUnsetLabel() |
77
|
|
|
{ |
78
|
|
|
// Remove the following lines when you implement this test. |
79
|
|
|
$this->markTestIncomplete( |
80
|
|
|
'This test has not been implemented yet.' |
81
|
|
|
); |
82
|
|
|
} |
83
|
|
|
|
84
|
|
|
/** |
85
|
|
|
* @covers FlexiPeeHP\Stitek::createNew |
86
|
|
|
*/ |
87
|
|
|
public function testCreateNew() |
88
|
|
|
{ |
89
|
|
|
$this->assertFalse($this->object->createNew('Without Invoice', |
|
|
|
|
90
|
|
|
['pokladna'])); |
91
|
|
|
|
92
|
|
|
$testCode = \Ease\Sand::randomString(); |
93
|
|
|
|
94
|
|
|
$this->assertTrue($this->object->createNew('Example Label', |
95
|
|
|
['faktura-vydana', 'faktura-prijata'], ['kod' => $testCode])); |
96
|
|
|
|
97
|
|
|
$this->object->deleteFromFlexiBee($this->object->getRecordIdent()); //Cleanup |
98
|
|
|
} |
99
|
|
|
} |
100
|
|
|
|
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.