Skip to content

Commit

Permalink
Finish PHPUnit 11 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
dvdoug committed Mar 22, 2024
1 parent c4bc936 commit 7c33394
Show file tree
Hide file tree
Showing 34 changed files with 198 additions and 300 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jobs:
- "8.3"
- "8.2"
- "8.1"
- "8.0"

dependencies:
- "highest"
Expand Down
1 change: 1 addition & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
'@PHP74Migration' => true,
'@PHP80Migration:risky' => true,
'@PHP80Migration' => true,
'@PHP81Migration' => true,
'concat_space' => ['spacing' => 'one'],
'fopen_flags' => ['b_mode' => true],
'native_function_invocation' => ['include' => ['@all']],
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Changed
- Updates to data for Czechia, Denmark, ETRS89, Portugal and St Helena
- Minimum PHP version increased to 8.1

## [5.8.0] - 2024-02-03
### Added
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
],
"license": "(MIT and proprietary)",
"require": {
"php": "^8.0",
"php": "^8.1",
"ext-zip": "*",
"composer-runtime-api": "^2.1",
"composer/pcre": "^3.1",
Expand All @@ -32,7 +32,7 @@
"php-coord/datapack-oceania": "dev-master",
"php-coord/datapack-southamerica": "dev-master",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^9.6||^10.0||^11.0"
"phpunit/phpunit": "^10.5||^11.0"
},
"suggest": {
"php-coord/datapack-africa": "High-accuracy addon datapack for Africa",
Expand Down
4 changes: 3 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<ini name="error_logging" value="-1"/>
</php>

<coverage pathCoverage="true" cacheDirectory="build/php-code-coverage-cache">
<source>
<include>
<directory suffix=".php">src</directory>
</include>
Expand All @@ -34,7 +34,9 @@
<directory suffix=".php">src/CoordinateOperation/Params</directory>
<directory suffix=".php">src/Geometry/Extents</directory>
</exclude>
</source>

<coverage pathCoverage="true" cacheDirectory="build/php-code-coverage-cache">
<report>
<text outputFile="php://stdout" showOnlySummary="true"/>
<html outputDirectory="build/coverage-phpunit"/>
Expand Down
8 changes: 4 additions & 4 deletions tests/CoordinateOperation/AutoConversionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
use PHPCoord\UnitOfMeasure\Angle\Radian;
use PHPCoord\UnitOfMeasure\Length\Foot;
use PHPCoord\UnitOfMeasure\Length\Metre;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\TestCase;

use function array_unique;
Expand Down Expand Up @@ -565,10 +567,8 @@ public function testRDNAPToITRF2014(): void
self::assertEqualsWithDelta(43.0197, $to->getHeight()->asMetres()->getValue(), 0.0001);
}

/**
* @group integration
* @dataProvider EPSGConcatenatedOperations
*/
#[DataProvider('EPSGConcatenatedOperations')]
#[Group('integration')]
public function testEPSGConcatenatedOperations(string $sourceCrsSrid, string $targetCrsSrid, array $extentCodes, bool $canReverse): void
{
$extent = BoundingArea::createFromExtentCodes($extentCodes);
Expand Down
8 changes: 4 additions & 4 deletions tests/CoordinateReferenceSystem/CompoundTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
namespace PHPCoord\CoordinateReferenceSystem;

use PHPCoord\Exception\UnknownCoordinateReferenceSystemException;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\TestCase;

use function count;
Expand Down Expand Up @@ -37,10 +39,8 @@ public function testCanGetSupportedWithHelp(): void
}
}

/**
* @group integration
* @dataProvider coordinateReferenceSystems
*/
#[DataProvider('coordinateReferenceSystems')]
#[Group('integration')]
public function testCanCreateSupported(string $srid): void
{
$object = Compound::fromSRID($srid);
Expand Down
8 changes: 4 additions & 4 deletions tests/CoordinateReferenceSystem/GeocentricTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
namespace PHPCoord\CoordinateReferenceSystem;

use PHPCoord\Exception\UnknownCoordinateReferenceSystemException;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\TestCase;

use function count;
Expand Down Expand Up @@ -37,10 +39,8 @@ public function testCanGetSupportedWithHelp(): void
}
}

/**
* @group integration
* @dataProvider coordinateReferenceSystems
*/
#[DataProvider('coordinateReferenceSystems')]
#[Group('integration')]
public function testCanCreateSupported(string $srid): void
{
$object = Geocentric::fromSRID($srid);
Expand Down
8 changes: 4 additions & 4 deletions tests/CoordinateReferenceSystem/Geographic2DTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
namespace PHPCoord\CoordinateReferenceSystem;

use PHPCoord\Exception\UnknownCoordinateReferenceSystemException;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\TestCase;

use function count;
Expand Down Expand Up @@ -37,10 +39,8 @@ public function testCanGetSupportedWithHelp(): void
}
}

/**
* @group integration
* @dataProvider coordinateReferenceSystems
*/
#[DataProvider('coordinateReferenceSystems')]
#[Group('integration')]
public function testCanCreateSupported(string $srid): void
{
$object = Geographic2D::fromSRID($srid);
Expand Down
8 changes: 4 additions & 4 deletions tests/CoordinateReferenceSystem/Geographic3DTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
namespace PHPCoord\CoordinateReferenceSystem;

use PHPCoord\Exception\UnknownCoordinateReferenceSystemException;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\TestCase;

use function count;
Expand Down Expand Up @@ -37,10 +39,8 @@ public function testCanGetSupportedWithHelp(): void
}
}

/**
* @group integration
* @dataProvider coordinateReferenceSystems
*/
#[DataProvider('coordinateReferenceSystems')]
#[Group('integration')]
public function testCanCreateSupported(string $srid): void
{
$object = Geographic3D::fromSRID($srid);
Expand Down
8 changes: 4 additions & 4 deletions tests/CoordinateReferenceSystem/ProjectedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

use PHPCoord\CoordinateOperation\CoordinateOperations;
use PHPCoord\Exception\UnknownCoordinateReferenceSystemException;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\TestCase;

use function count;
Expand Down Expand Up @@ -38,10 +40,8 @@ public function testCanGetSupportedWithHelp(): void
}
}

/**
* @group integration
* @dataProvider coordinateReferenceSystems
*/
#[DataProvider('coordinateReferenceSystems')]
#[Group('integration')]
public function testCanCreateSupported(string $srid): void
{
$object = Projected::fromSRID($srid);
Expand Down
8 changes: 4 additions & 4 deletions tests/CoordinateReferenceSystem/VerticalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
namespace PHPCoord\CoordinateReferenceSystem;

use PHPCoord\Exception\UnknownCoordinateReferenceSystemException;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\TestCase;

use function count;
Expand Down Expand Up @@ -37,10 +39,8 @@ public function testCanGetSupportedWithHelp(): void
}
}

/**
* @group integration
* @dataProvider coordinateReferenceSystems
*/
#[DataProvider('coordinateReferenceSystems')]
#[Group('integration')]
public function testCanCreateSupported(string $srid): void
{
$object = Vertical::fromSRID($srid);
Expand Down
3 changes: 2 additions & 1 deletion tests/CoordinateSystem/CartesianTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
namespace PHPCoord\CoordinateSystem;

use PHPCoord\Exception\UnknownCoordinateSystemException;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\TestCase;

use function count;
Expand Down Expand Up @@ -36,9 +37,9 @@ public function testCanGetSupportedWithHelp(): void
}

/**
* @group integration
* @dataProvider cartesian
*/
#[Group('integration')]
public function testCanCreateSupportedCartesian(string $srid): void
{
$object = Cartesian::fromSRID($srid);
Expand Down
3 changes: 2 additions & 1 deletion tests/CoordinateSystem/EllipsoidalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
namespace PHPCoord\CoordinateSystem;

use PHPCoord\Exception\UnknownCoordinateSystemException;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\TestCase;

use function count;
Expand Down Expand Up @@ -36,9 +37,9 @@ public function testCanGetSupportedWithHelp(): void
}

/**
* @group integration
* @dataProvider ellipsoidal
*/
#[Group('integration')]
public function testCanCreateSupportedEllipsoidal(string $srid): void
{
$object = Ellipsoidal::fromSRID($srid);
Expand Down
3 changes: 2 additions & 1 deletion tests/CoordinateSystem/VerticalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
namespace PHPCoord\CoordinateSystem;

use PHPCoord\Exception\UnknownCoordinateSystemException;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\TestCase;

use function count;
Expand Down Expand Up @@ -36,9 +37,9 @@ public function testCanGetSupportedWithHelp(): void
}

/**
* @group integration
* @dataProvider vertical
*/
#[Group('integration')]
public function testCanCreateSupportedVertical(string $srid): void
{
$object = Vertical::fromSRID($srid);
Expand Down
3 changes: 2 additions & 1 deletion tests/Datum/DatumTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

use PHPCoord\Exception\UnknownDatumException;
use PHPCoord\UnitOfMeasure\Length\Metre;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\TestCase;

use function count;
Expand Down Expand Up @@ -37,9 +38,9 @@ public function testCanGetSupportedWithHelp(): void
}

/**
* @group integration
* @dataProvider datums
*/
#[Group('integration')]
public function testCanCreateSupported(string $srid): void
{
$object = Datum::fromSRID($srid);
Expand Down
3 changes: 2 additions & 1 deletion tests/Datum/EllipsoidTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
namespace PHPCoord\Datum;

use PHPCoord\Exception\UnknownEllipsoidException;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\TestCase;

use function count;
Expand Down Expand Up @@ -36,9 +37,9 @@ public function testCanGetSupportedWithHelp(): void
}

/**
* @group integration
* @dataProvider ellipsoids
*/
#[Group('integration')]
public function testCanCreateSupported(string $srid): void
{
$object = Ellipsoid::fromSRID($srid);
Expand Down
3 changes: 2 additions & 1 deletion tests/Datum/PrimeMeridianTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

use PHPCoord\Exception\UnknownPrimeMeridianException;
use PHPCoord\UnitOfMeasure\Angle\Degree;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\TestCase;

use function count;
Expand Down Expand Up @@ -37,9 +38,9 @@ public function testCanGetSupportedWithHelp(): void
}

/**
* @group integration
* @dataProvider primeMeridians
*/
#[Group('integration')]
public function testCanCreateSupported(string $srid): void
{
$object = PrimeMeridian::fromSRID($srid);
Expand Down

0 comments on commit 7c33394

Please sign in to comment.