Skip to content

Commit 7a90ca9

Browse files
committed
Add return types to test methods
1 parent 90cb500 commit 7a90ca9

File tree

8 files changed

+39
-39
lines changed

8 files changed

+39
-39
lines changed

tests/ToolkitApiTest/HttpSuppTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
final class HttpSuppTest extends TestCase
88
{
9-
public function testCanSetIpc()
9+
public function testCanSetIpc(): void
1010
{
1111
$ipc = 'test';
1212

@@ -16,7 +16,7 @@ public function testCanSetIpc()
1616
$this->assertEquals($ipc, $httpsupp->getIpc());
1717
}
1818

19-
public function testIsIpcSet()
19+
public function testIsIpcSet(): void
2020
{
2121
$ipc = 'test';
2222

tests/ToolkitApiTest/Int16ParamTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212
final class Int16ParamTest extends TestCase
1313
{
14-
public function testCanCreateInstance()
14+
public function testCanCreateInstance(): void
1515
{
1616
$parameter = new Int16Param('both', 'test comment', 'testVar', 8);
1717
$this->assertTrue($parameter instanceof ProgramParameter);

tests/ToolkitApiTest/Int8ParamTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212
final class Int8ParamTest extends TestCase
1313
{
14-
public function testCanCreateInstance()
14+
public function testCanCreateInstance(): void
1515
{
1616
$parameter = new Int8Param('both', 'test comment', 'testVar', 8);
1717
$this->assertTrue($parameter instanceof ProgramParameter);

tests/ToolkitApiTest/ToolkitServiceParameterTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ protected function setUp(): void
4848
);
4949
}
5050

51-
public function testCanGetParameterProperties()
51+
public function testCanGetParameterProperties(): void
5252
{
5353
$data1 = $this->programParameter->getParamProperities();
5454
$data2 = array(
@@ -73,7 +73,7 @@ public function testCanGetParameterProperties()
7373
$this->assertEquals($data1, $data2);
7474
}
7575

76-
public function testGetParameterPropertiesFacadeMethodReturnsSameAsRealMethod()
76+
public function testGetParameterPropertiesFacadeMethodReturnsSameAsRealMethod(): void
7777
{
7878
$data1 = $this->programParameter->getParamProperities();
7979
$data2 = $this->programParameter->getParamProperties();
@@ -176,7 +176,7 @@ protected function setUp(): void
176176
$this->programParameter = new ProgramParameter($type, 'both', 'p1', 'test', 'off', 0, '', false);
177177
}
178178

179-
public function testCanConvertBinaryToString()
179+
public function testCanConvertBinaryToString(): void
180180
{
181181
$hex = '74657374';
182182
$data1 = $this->binParam->bin2str($hex);

tests/ToolkitApiTest/ToolkitTest.php

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -40,126 +40,126 @@ protected function setUp(): void
4040
$this->toolkit = new Toolkit('*LOCAL', '0', 'testPwd', 'http', false);
4141
}
4242

43-
public function testCanAddSigned8ByteIntegerParameter()
43+
public function testCanAddSigned8ByteIntegerParameter(): void
4444
{
4545
$parameter = $this->toolkit->AddParameterInt8('both', 'test comment', 'testVar', 8);
4646

4747
$this->assertTrue($parameter instanceof Int8Param);
4848
}
4949

50-
public function testCanAddSigned16ByteIntegerParameter()
50+
public function testCanAddSigned16ByteIntegerParameter(): void
5151
{
5252
$parameter = $this->toolkit->AddParameterInt16('both', 'test comment', 'testVar', 10);
5353

5454
$this->assertTrue($parameter instanceof Int16Param);
5555
}
5656

57-
public function testCanAddSigned32ByteIntegerParameter()
57+
public function testCanAddSigned32ByteIntegerParameter(): void
5858
{
5959
$parameter = $this->toolkit->AddParameterInt32('both', 'test comment', 'testVar', 100);
6060

6161
$this->assertTrue($parameter instanceof Int32Param);
6262
}
6363

64-
public function testCanAddSigned64ByteIntegerParameter()
64+
public function testCanAddSigned64ByteIntegerParameter(): void
6565
{
6666
$parameter = $this->toolkit->AddParameterInt64('both', 'test comment', 'testVar', 1000);
6767

6868
$this->assertTrue($parameter instanceof Int64Param);
6969
}
7070

71-
public function testCanAddUnsigned8ByteIntegerParameter()
71+
public function testCanAddUnsigned8ByteIntegerParameter(): void
7272
{
7373
$parameter = $this->toolkit->AddParameterUInt8('both', 'test comment', 'testVar', 8);
7474

7575
$this->assertTrue($parameter instanceof UInt8Param);
7676
}
7777

78-
public function testCanAddUnsigned16ByteIntegerParameter()
78+
public function testCanAddUnsigned16ByteIntegerParameter(): void
7979
{
8080
$parameter = $this->toolkit->AddParameterUInt16('both', 'test comment', 'testVar', 8);
8181

8282
$this->assertTrue($parameter instanceof UInt16Param);
8383
}
8484

85-
public function testCanAddUnsigned32ByteIntegerParameter()
85+
public function testCanAddUnsigned32ByteIntegerParameter(): void
8686
{
8787
$parameter = $this->toolkit->AddParameterUInt32('both', 'test comment', 'testVar', 8);
8888

8989
$this->assertTrue($parameter instanceof UInt32Param);
9090
}
9191

92-
public function testCanAddUnsigned64ByteIntegerParameter()
92+
public function testCanAddUnsigned64ByteIntegerParameter(): void
9393
{
9494
$parameter = $this->toolkit->AddParameterUInt64('both', 'test comment', 'testVar', 8);
9595

9696
$this->assertTrue($parameter instanceof UInt64Param);
9797
}
9898

99-
public function testCanAddCharacterParameter()
99+
public function testCanAddCharacterParameter(): void
100100
{
101101
$parameter = $this->toolkit->AddParameterChar('both', 10, 'CODE', 'CODE', 'code');
102102

103103
$this->assertTrue($parameter instanceof CharParam);
104104
}
105105

106-
public function testCanAddFloatParameter()
106+
public function testCanAddFloatParameter(): void
107107
{
108108
$parameter = $this->toolkit->AddParameterFloat('both', 'test comment', 'varName', 'false');
109109

110110
$this->assertTrue($parameter instanceof FloatParam);
111111
}
112112

113-
public function testCanAddRealParameter()
113+
public function testCanAddRealParameter(): void
114114
{
115115
$parameter = $this->toolkit->AddParameterReal('both', 'test comment', 'varName', 'testValue');
116116

117117
$this->assertTrue($parameter instanceof RealParam);
118118
}
119119

120-
public function testCanAddPackedDecimalParameter()
120+
public function testCanAddPackedDecimalParameter(): void
121121
{
122122
$parameter = $this->toolkit->AddParameterPackDec('both', 7,4, 'INDEC1', 'var3', '001.0001');
123123

124124
$this->assertTrue($parameter instanceof PackedDecParam);
125125
}
126126

127-
public function testCanAddZonedParameter()
127+
public function testCanAddZonedParameter(): void
128128
{
129129
$parameter = $this->toolkit->AddParameterZoned('both', 12, 2, 'Check amount', 'amount', '2000.25');
130130

131131
$this->assertTrue($parameter instanceof ZonedParam);
132132
}
133133

134-
public function testCanAddParameterHole()
134+
public function testCanAddParameterHole(): void
135135
{
136136
$parameter = $this->toolkit->AddParameterHole(12, 'hole');
137137

138138
$this->assertTrue($parameter instanceof HoleParam);
139139
}
140140

141-
public function testCanAddBinaryParameter()
141+
public function testCanAddBinaryParameter(): void
142142
{
143143
$parameter = $this->toolkit->AddParameterBin('both', 20, 'UncodeSample', 'p1', 'test');
144144

145145
$this->assertTrue($parameter instanceof BinParam);
146146
}
147147

148-
public function testCanAddParameterSize()
148+
public function testCanAddParameterSize(): void
149149
{
150150
$size = $this->toolkit->AddParameterSize('test comment', 'varName', 3);
151151

152152
$this->assertTrue($size instanceof SizeParam);
153153
}
154154

155-
public function testCanAddParameterSizePack()
155+
public function testCanAddParameterSizePack(): void
156156
{
157157
$parameter = $this->toolkit->AddParameterSizePack('test comment', 'varName', 4);
158158

159159
$this->assertTrue($parameter instanceof SizePackParam);
160160
}
161161

162-
public function testCanSetPersistent()
162+
public function testCanSetPersistent(): void
163163
{
164164
$isPersistent = false;
165165

@@ -168,63 +168,63 @@ public function testCanSetPersistent()
168168
$this->assertEquals($isPersistent, $this->toolkit->getIsPersistent());
169169
}
170170

171-
public function testCanReturnScriptAbsolutePath()
171+
public function testCanReturnScriptAbsolutePath(): void
172172
{
173173
$path = Toolkit::classPath();
174174

175175
$this->assertEquals($path, $this->toolkit->classPath());
176176
}
177177

178-
public function testCanGetPhpOperatingSystem()
178+
public function testCanGetPhpOperatingSystem(): void
179179
{
180180
$os = php_uname('s');
181181

182182
$this->assertEquals($os, $this->toolkit->getPhpOperatingSystem());
183183
}
184184

185-
public function testCanTellIfPhpIsRunningOnIbmI()
185+
public function testCanTellIfPhpIsRunningOnIbmI(): void
186186
{
187187
$isRunningOnIbmI = (php_uname('s') === 'OS400');
188188

189189
$this->assertEquals($isRunningOnIbmI, $this->toolkit->isPhpRunningOnIbmI());
190190
}
191191

192-
public function testDatabaseNameOrResourceIsNotBoolean()
192+
public function testDatabaseNameOrResourceIsNotBoolean(): void
193193
{
194194
$resource = false;
195195
$this->expectException(Exception::class);
196196
new Toolkit($resource);
197197
}
198198

199-
public function testDatabaseNameOrResourceIsNotFloat()
199+
public function testDatabaseNameOrResourceIsNotFloat(): void
200200
{
201201
$resource = 1.81;
202202
$this->expectException(Exception::class);
203203
new Toolkit($resource);
204204
}
205205

206-
public function testDatabaseNameOrResourceIsNotObject()
206+
public function testDatabaseNameOrResourceIsNotObject(): void
207207
{
208208
$resource = new DataArea();
209209
$this->expectException(Exception::class);
210210
new Toolkit($resource);
211211
}
212212

213-
public function testDatabaseNameOrResourceIsNotInteger()
213+
public function testDatabaseNameOrResourceIsNotInteger(): void
214214
{
215215
$resource = 12;
216216
$this->expectException(Exception::class);
217217
new Toolkit($resource);
218218
}
219219

220-
public function testDatabaseNameOrResourceIsNotArray()
220+
public function testDatabaseNameOrResourceIsNotArray(): void
221221
{
222222
$resource = array(1, 2, 3);
223223
$this->expectException(Exception::class);
224224
new Toolkit($resource);
225225
}
226226

227-
public function testDatabaseNameOrResourceIsNotNull()
227+
public function testDatabaseNameOrResourceIsNotNull(): void
228228
{
229229
$resource = null;
230230
$this->expectException(Exception::class);

tests/ToolkitApiTest/UInt16ParamTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212
final class UInt16ParamTest extends TestCase
1313
{
14-
public function testCanCreateInstance()
14+
public function testCanCreateInstance(): void
1515
{
1616
$parameter = new UInt16Param('both', 'test comment', 'testVar', 8);
1717
$this->assertTrue($parameter instanceof ProgramParameter);

tests/ToolkitApiTest/UInt8ParamTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212
final class UInt8ParamTest extends TestCase
1313
{
14-
public function testCanCreateInstance()
14+
public function testCanCreateInstance(): void
1515
{
1616
$parameter = new UInt8Param('both', 'test comment', 'testVar', 8);
1717
$this->assertTrue($parameter instanceof ProgramParameter);

tests/functional/ToolkitTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ protected function setUp(): void
3232
/**
3333
* @throws \Exception
3434
*/
35-
public function testCanPassPdoOdbcObjectToToolkit()
35+
public function testCanPassPdoOdbcObjectToToolkit(): void
3636
{
3737
$pdo = new \PDO(
3838
'odbc:' . $this->connectionOptions['dsn'],
@@ -55,7 +55,7 @@ public function testCanPassPdoOdbcObjectToToolkit()
5555
/**
5656
* @throws \Exception
5757
*/
58-
public function testCanPassOdbcResourceToToolkit()
58+
public function testCanPassOdbcResourceToToolkit(): void
5959
{
6060
$connection = odbc_connect($this->connectionOptions['dsn'], $this->connectionOptions['username'], $this->connectionOptions['password']);
6161

@@ -71,7 +71,7 @@ public function testCanPassOdbcResourceToToolkit()
7171
/**
7272
* @throws \Exception
7373
*/
74-
public function testCanPassOdbcConnectionParametersToToolkit()
74+
public function testCanPassOdbcConnectionParametersToToolkit(): void
7575
{
7676
$toolkit = new Toolkit(
7777
$this->connectionOptions['dsn'],

0 commit comments

Comments
 (0)