Skip to content

Commit 72de876

Browse files
committed
update tests
1 parent 2d6196f commit 72de876

File tree

4 files changed

+212
-61
lines changed

4 files changed

+212
-61
lines changed

src/IPSQRCodeParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ class IPSQRCodeParser
265265
private $QRCodeObject;
266266
private string $QRCodeString;
267267

268-
public function __construct($QRCodeString, $returntype = 'array')
268+
public function __construct($QRCodeString)
269269
{
270270
//set QRCodeObject
271271
$this->QRCodeObject = new IPSQRCodeObject();

tests/IPSQRCodeObjectTest.php

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
<?php
2+
3+
namespace MediGeek;
4+
5+
use MediGeek\IPSQRCodeObject;
6+
use PHPUnit\Framework\TestCase;
7+
8+
/**
9+
* Generated by PHPUnit_SkeletonGenerator on 2020-07-12 at 19:40:33.
10+
*/
11+
class IPSQRCodeObjectTest extends TestCase
12+
{
13+
14+
/**
15+
* @var IPSQRCodeObject
16+
*/
17+
protected $object;
18+
19+
/**
20+
* Sets up the fixture, for example, opens a network connection.
21+
* This method is called before a test is executed.
22+
*/
23+
protected function setUp(): void
24+
{
25+
$this->object = new IPSQRCodeObject;
26+
}
27+
28+
/**
29+
* Tears down the fixture, for example, closes a network connection.
30+
* This method is called after a test is executed.
31+
*/
32+
protected function tearDown(): void
33+
{
34+
35+
}
36+
37+
/**
38+
* @covers MediGeek\IPSQRCodeObject::get
39+
* @todo Implement testGet().
40+
*/
41+
public function testGet()
42+
{
43+
// Remove the following lines when you implement this test.
44+
$this->markTestIncomplete(
45+
'This test has not been implemented yet.'
46+
);
47+
}
48+
49+
/**
50+
* @covers MediGeek\IPSQRCodeObject::set
51+
* @todo Implement testSet().
52+
*/
53+
public function testSet()
54+
{
55+
// Remove the following lines when you implement this test.
56+
$this->markTestIncomplete(
57+
'This test has not been implemented yet.'
58+
);
59+
}
60+
61+
/**
62+
* @covers MediGeek\IPSQRCodeObject::getMultiple
63+
* @todo Implement testGetMultiple().
64+
*/
65+
public function testGetMultiple()
66+
{
67+
// Remove the following lines when you implement this test.
68+
$this->markTestIncomplete(
69+
'This test has not been implemented yet.'
70+
);
71+
}
72+
73+
/**
74+
* @covers MediGeek\IPSQRCodeObject::setMultiple
75+
* @todo Implement testSetMultiple().
76+
*/
77+
public function testSetMultiple()
78+
{
79+
// Remove the following lines when you implement this test.
80+
$this->markTestIncomplete(
81+
'This test has not been implemented yet.'
82+
);
83+
}
84+
85+
/**
86+
* @covers MediGeek\IPSQRCodeObject::getAll
87+
* @todo Implement testGetAll().
88+
*/
89+
public function testGetAll()
90+
{
91+
// Remove the following lines when you implement this test.
92+
$this->markTestIncomplete(
93+
'This test has not been implemented yet.'
94+
);
95+
}
96+
}

tests/IPSQRCodeParserTest.php

Lines changed: 114 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -2,61 +2,125 @@
22

33
namespace MediGeek;
44

5-
//require 'bootstrap.php';
6-
7-
use PHPUnit\Framework\TestCase;
85
use MediGeek\IPSQRCodeParser;
9-
10-
/*
11-
* The MIT License
12-
*
13-
* Copyright 2020 Savvas Radevic.
14-
*
15-
* Permission is hereby granted, free of charge, to any person obtaining a copy
16-
* of this software and associated documentation files (the "Software"), to deal
17-
* in the Software without restriction, including without limitation the rights
18-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
19-
* copies of the Software, and to permit persons to whom the Software is
20-
* furnished to do so, subject to the following conditions:
21-
*
22-
* The above copyright notice and this permission notice shall be included in
23-
* all copies or substantial portions of the Software.
24-
*
25-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
30-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
31-
* THE SOFTWARE.
32-
*/
6+
use PHPUnit\Framework\TestCase;
337

348
/**
35-
* IPSQRCodeTest
36-
*
37-
* @author Savvas Radevic
9+
* Generated by PHPUnit_SkeletonGenerator on 2020-07-12 at 19:45:29.
3810
*/
39-
class IPSQRCodeParserTest extends TestCase {
40-
41-
public function testIPSQRCodeParser(): void {
42-
$c = new IPSQRCodeParser("K:PR|V:01|C:1|R:160000000003465595|N:JKP INFOSTAN TEHNOLOGIJE BEOGRAD|I:RSD9999,99|SF:122|S:OBJEDINJENA NAPLATA|RO:11800515599052-20060-1");
43-
44-
$this->assertEquals(
45-
46-
array(
47-
"K" => "PR",
48-
"V" => "01",
49-
"C" => "1",
50-
"R" => "160000000003465595",
51-
"N" =>"JKP INFOSTAN TEHNOLOGIJE BEOGRAD",
52-
"I" => "RSD9999,99",
53-
"SF" => "122",
54-
"S" => "OBJEDINJENA NAPLATA",
55-
"RO"=> "11800515599052-20060-1",
56-
),
57-
58-
$c->parseSplit()
11+
class IPSQRCodeParserTest extends TestCase
12+
{
13+
14+
/**
15+
* @var IPSQRCodeParser
16+
*/
17+
protected $object;
18+
19+
/**
20+
* Sets up the fixture, for example, opens a network connection.
21+
* This method is called before a test is executed.
22+
*/
23+
protected function setUp(): void
24+
{
25+
$this->object = new IPSQRCodeParser("K:PR|V:01|C:1|R:160000000003465595"
26+
. "|N:JKP INFOSTAN TEHNOLOGIJE BEOGRAD|I:RSD9999,99|SF:122|S:OBJEDIN"
27+
. "JENA NAPLATA|RO:11800515599052-20060-1");
28+
}
29+
30+
/**
31+
* Tears down the fixture, for example, closes a network connection.
32+
* This method is called after a test is executed.
33+
*/
34+
protected function tearDown(): void
35+
{
36+
$this->object = new IPSQRCodeParser("K:PR|V:01|C:1|R:160000000000060216|N:Telekom Srbija A.D.
37+
Takovska 2
38+
Beograd|I:RSD999,99|P:SAVVAS RADEVIĆ
39+
IMEULICE 01
40+
11000 BEOGRAD 6|SF:189|S:MTS Račun 01/2020 12345566/2|RO:97082240113797893");
41+
}
42+
43+
/**
44+
* @covers MediGeek\IPSQRCodeParser::mapKeys
45+
* @todo Implement testMapKeys().
46+
*/
47+
public function testMapKeys()
48+
{
49+
// Remove the following lines when you implement this test.
50+
$this->markTestIncomplete(
51+
'This test has not been implemented yet.'
52+
);
53+
}
54+
55+
/**
56+
* @covers MediGeek\IPSQRCodeParser::validate
57+
* @todo Implement testValidate().
58+
*/
59+
public function testValidate()
60+
{
61+
// Remove the following lines when you implement this test.
62+
$this->markTestIncomplete(
63+
'This test has not been implemented yet.'
5964
);
6065
}
6166

67+
/**
68+
* @covers MediGeek\IPSQRCodeParser::setQRCodeObjectVar
69+
* @todo Implement testSetQRCodeObjectVar().
70+
*/
71+
public function testSetQRCodeObjectVar()
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 MediGeek\IPSQRCodeParser::get
81+
* @todo Implement testGet().
82+
*/
83+
public function testGet()
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 MediGeek\IPSQRCodeParser::parse
93+
* @todo Implement testParse().
94+
*/
95+
public function testParse()
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 MediGeek\IPSQRCodeParser::parseSplit
105+
* @todo Implement testParseSplit().
106+
*/
107+
public function testParseSplit()
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 MediGeek\IPSQRCodeParser::parseCurrencyAndAmount
117+
* @todo Implement testParseCurrencyAndAmount().
118+
*/
119+
public function testParseCurrencyAndAmount()
120+
{
121+
// Remove the following lines when you implement this test.
122+
$this->markTestIncomplete(
123+
'This test has not been implemented yet.'
124+
);
125+
}
62126
}

tests/configuration.xml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2323
THE SOFTWARE.
2424
-->
2525

26-
<!-- see http://www.phpunit.de/wiki/Documentation -->
27-
<!--phpunit bootstrap="/path/to/bootstrap.php"
28-
colors="false"
29-
convertErrorsToExceptions="true"
30-
convertNoticesToExceptions="true"
31-
convertWarningsToExceptions="true"
32-
stopOnFailure="true">
33-
</phpunit-->
34-
35-
<phpunit colors="true" bootstrap="bootstrap.php">
26+
<phpunit colors="true">
3627
<testsuites>
3728
<testsuite name="Initial tests">
3829
<directory>tests/</directory>

0 commit comments

Comments
 (0)