Skip to content

Commit

Permalink
feat: modernise, drop support for php < 7.4, migrate tests and config…
Browse files Browse the repository at this point in the history
… for phpUnit 9, replace travis with github actions
  • Loading branch information
Chris8934 committed Feb 4, 2023
1 parent 2884e02 commit 30ce239
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

"require-dev": {
"phpunit/phpunit": "^9.5",
"squizlabs/php_codesniffer": "^2.8.1"
"squizlabs/php_codesniffer": "^3.7"
},

"replace": {
Expand Down
19 changes: 6 additions & 13 deletions tests/AbstractPhysicalQuantityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ public function testConvertToUnknownUnitThrowsException(
AbstractPhysicalQuantity $value,
$arbitraryUnit,
$valueInArbitraryUnit
): void
{
): void {
$this->expectException(\PhpUnitsOfMeasure\Exception\UnknownUnitOfMeasure::class);
$value->toUnit('someUnknownUnit');
}
Expand All @@ -125,8 +124,7 @@ public function testUnitConvertsToArbitraryUnit(
AbstractPhysicalQuantity $value,
$arbitraryUnit,
$valueInArbitraryUnit
): void
{
): void {
$this->assertSame($valueInArbitraryUnit, $value->toUnit($arbitraryUnit));
}

Expand All @@ -146,8 +144,7 @@ public function testSerialize(
AbstractPhysicalQuantity $value,
$arbitraryUnit,
$valueInArbitraryUnit
): void
{
): void {
serialize($value);
}

Expand All @@ -158,8 +155,7 @@ public function testUnserialize(
AbstractPhysicalQuantity $value,
$arbitraryUnit,
$valueInArbitraryUnit
): void
{
): void {
$unserializedValue = unserialize(serialize($value));

$this->assertSame($valueInArbitraryUnit, $unserializedValue->toUnit($arbitraryUnit));
Expand All @@ -175,8 +171,7 @@ public function testAdd(
AbstractPhysicalQuantity $secondValue,
$sumString,
$diffString
): void
{
): void {
if ($shouldThrowException) {
$this->expectException(PhysicalQuantityMismatch::class);
}
Expand All @@ -198,11 +193,9 @@ public function testSubtract(
AbstractPhysicalQuantity $secondValue,
$sumString,
$diffString
): void
{
): void {
if ($shouldThrowException) {
$this->expectException(PhysicalQuantityMismatch::class);

}

$difference = $firstValue->subtract($secondValue);
Expand Down

0 comments on commit 30ce239

Please sign in to comment.