Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade PHPUnit to v11 #217

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
}
},
"require-dev": {
"phpunit/phpunit": "^8.2",
"phpunit/phpunit": "^11.0",
"symfony/process": "^4.3"
}
}
4 changes: 2 additions & 2 deletions tests/ToolkitApiTest/HttpSuppTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

final class HttpSuppTest extends TestCase
{
public function testCanSetIpc()
public function testCanSetIpc(): void
{
$ipc = 'test';

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

public function testIsIpcSet()
public function testIsIpcSet(): void
{
$ipc = 'test';

Expand Down
2 changes: 1 addition & 1 deletion tests/ToolkitApiTest/Int16ParamTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
final class Int16ParamTest extends TestCase
{
public function testCanCreateInstance()
public function testCanCreateInstance(): void
{
$parameter = new Int16Param('both', 'test comment', 'testVar', 8);
$this->assertTrue($parameter instanceof ProgramParameter);
Expand Down
2 changes: 1 addition & 1 deletion tests/ToolkitApiTest/Int8ParamTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
final class Int8ParamTest extends TestCase
{
public function testCanCreateInstance()
public function testCanCreateInstance(): void
{
$parameter = new Int8Param('both', 'test comment', 'testVar', 8);
$this->assertTrue($parameter instanceof ProgramParameter);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ final class ProgramParameterTest extends TestCase
protected $dim;
protected $by;

public function setUp(): void
protected function setUp(): void
{
$this->size = 20;
$this->type = sprintf('%dB', $this->size);
Expand All @@ -48,7 +48,7 @@ public function setUp(): void
);
}

public function testCanGetParameterProperties()
public function testCanGetParameterProperties(): void
{
$data1 = $this->programParameter->getParamProperities();
$data2 = array(
Expand All @@ -73,7 +73,7 @@ public function testCanGetParameterProperties()
$this->assertEquals($data1, $data2);
}

public function testGetParameterPropertiesFacadeMethodReturnsSameAsRealMethod()
public function testGetParameterPropertiesFacadeMethodReturnsSameAsRealMethod(): void
{
$data1 = $this->programParameter->getParamProperities();
$data2 = $this->programParameter->getParamProperties();
Expand Down Expand Up @@ -168,15 +168,15 @@ final class BinParamTest extends TestCase
*/
protected $programParameter;

public function setUp(): void
protected function setUp(): void
{
$size = 20;
$this->binParam = new BinParam('both', $size, 'UncodeSample', 'p1', 'test');
$type = sprintf('%dB', $size);
$this->programParameter = new ProgramParameter($type, 'both', 'p1', 'test', 'off', 0, '', false);
}

public function testCanConvertBinaryToString()
public function testCanConvertBinaryToString(): void
{
$hex = '74657374';
$data1 = $this->binParam->bin2str($hex);
Expand Down
56 changes: 28 additions & 28 deletions tests/ToolkitApiTest/ToolkitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,131 +35,131 @@ final class ToolkitTest extends TestCase
*/
protected $toolkit;

public function setUp(): void
protected function setUp(): void
{
$this->toolkit = new Toolkit('*LOCAL', '0', 'testPwd', 'http', false);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

public function testCanSetPersistent()
public function testCanSetPersistent(): void
{
$isPersistent = false;

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

public function testCanReturnScriptAbsolutePath()
public function testCanReturnScriptAbsolutePath(): void
{
$path = Toolkit::classPath();

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

public function testCanGetPhpOperatingSystem()
public function testCanGetPhpOperatingSystem(): void
{
$os = php_uname('s');

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

public function testCanTellIfPhpIsRunningOnIbmI()
public function testCanTellIfPhpIsRunningOnIbmI(): void
{
$isRunningOnIbmI = (php_uname('s') === 'OS400');

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

public function testDatabaseNameOrResourceIsNotBoolean()
public function testDatabaseNameOrResourceIsNotBoolean(): void
{
$resource = false;
$this->expectException(Exception::class);
new Toolkit($resource);
}

public function testDatabaseNameOrResourceIsNotFloat()
public function testDatabaseNameOrResourceIsNotFloat(): void
{
$resource = 1.81;
$this->expectException(Exception::class);
new Toolkit($resource);
}

public function testDatabaseNameOrResourceIsNotObject()
public function testDatabaseNameOrResourceIsNotObject(): void
{
$resource = new DataArea();
$this->expectException(Exception::class);
new Toolkit($resource);
}

public function testDatabaseNameOrResourceIsNotInteger()
public function testDatabaseNameOrResourceIsNotInteger(): void
{
$resource = 12;
$this->expectException(Exception::class);
new Toolkit($resource);
}

public function testDatabaseNameOrResourceIsNotArray()
public function testDatabaseNameOrResourceIsNotArray(): void
{
$resource = array(1, 2, 3);
$this->expectException(Exception::class);
new Toolkit($resource);
}

public function testDatabaseNameOrResourceIsNotNull()
public function testDatabaseNameOrResourceIsNotNull(): void
{
$resource = null;
$this->expectException(Exception::class);
Expand Down
2 changes: 1 addition & 1 deletion tests/ToolkitApiTest/UInt16ParamTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
final class UInt16ParamTest extends TestCase
{
public function testCanCreateInstance()
public function testCanCreateInstance(): void
{
$parameter = new UInt16Param('both', 'test comment', 'testVar', 8);
$this->assertTrue($parameter instanceof ProgramParameter);
Expand Down
2 changes: 1 addition & 1 deletion tests/ToolkitApiTest/UInt8ParamTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
final class UInt8ParamTest extends TestCase
{
public function testCanCreateInstance()
public function testCanCreateInstance(): void
{
$parameter = new UInt8Param('both', 'test comment', 'testVar', 8);
$this->assertTrue($parameter instanceof ProgramParameter);
Expand Down
8 changes: 4 additions & 4 deletions tests/functional/ToolkitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ final class ToolkitTest extends TestCase
*/
private $toolkitOptions;

public function setUp(): void
protected function setUp(): void
{
$config = getConfig();

Expand All @@ -32,7 +32,7 @@ public function setUp(): void
/**
* @throws \Exception
*/
public function testCanPassPdoOdbcObjectToToolkit()
public function testCanPassPdoOdbcObjectToToolkit(): void
{
$pdo = new \PDO(
'odbc:' . $this->connectionOptions['dsn'],
Expand All @@ -55,7 +55,7 @@ public function testCanPassPdoOdbcObjectToToolkit()
/**
* @throws \Exception
*/
public function testCanPassOdbcResourceToToolkit()
public function testCanPassOdbcResourceToToolkit(): void
{
$connection = odbc_connect($this->connectionOptions['dsn'], $this->connectionOptions['username'], $this->connectionOptions['password']);

Expand All @@ -71,7 +71,7 @@ public function testCanPassOdbcResourceToToolkit()
/**
* @throws \Exception
*/
public function testCanPassOdbcConnectionParametersToToolkit()
public function testCanPassOdbcConnectionParametersToToolkit(): void
{
$toolkit = new Toolkit(
$this->connectionOptions['dsn'],
Expand Down