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 24, 2024
1 parent c4bc936 commit 8522d6f
Show file tree
Hide file tree
Showing 35 changed files with 215 additions and 321 deletions.
7 changes: 4 additions & 3 deletions .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 Expand Up @@ -122,11 +121,13 @@ jobs:
- name: PHPUnit (Unit)
run: |
if [ "${{ matrix.php-version }}" = "8.2" ] && [ "${{ matrix.dependencies }}" = "highest" ]; then
php -dmemory_limit=-1 vendor/phpunit/phpunit/phpunit --coverage-clover=build/coverage-phpunit/clover.xml --exclude-group=integration,gigs;
php -dmemory_limit=-1 vendor/phpunit/phpunit/phpunit --coverage-clover=build/coverage-phpunit/clover.xml --exclude-group=integration --exclude-group=gigs;
composer global require scrutinizer/ocular;
~/.composer/vendor/bin/ocular code-coverage:upload --format=php-clover build/coverage-phpunit/clover.xml;
else
elif [ "${{ matrix.php-version }}" = "8.1" ] || [ "${{ matrix.dependencies }}" = "lowest" ]; then
php -dmemory_limit=-1 vendor/phpunit/phpunit/phpunit --exclude-group=integration,gigs --no-coverage;
else
php -dmemory_limit=-1 vendor/phpunit/phpunit/phpunit --exclude-group=integration --exclude-group=gigs --no-coverage;
fi;
- name: PHPUnit (Integration)
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
2 changes: 1 addition & 1 deletion .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ build:
environment:
# Languages
php:
version: "8.0"
version: "8.1"
ini:
memory_limit: "-1"

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
8 changes: 4 additions & 4 deletions tests/CoordinateSystem/CartesianTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
namespace PHPCoord\CoordinateSystem;

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

use function count;
Expand All @@ -35,10 +37,8 @@ public function testCanGetSupportedWithHelp(): void
}
}

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

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

use function count;
Expand All @@ -35,10 +37,8 @@ public function testCanGetSupportedWithHelp(): void
}
}

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

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

use function count;
Expand All @@ -35,10 +37,8 @@ public function testCanGetSupportedWithHelp(): void
}
}

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

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

use function count;
Expand All @@ -36,10 +38,8 @@ public function testCanGetSupportedWithHelp(): void
}
}

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

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

use function count;
Expand All @@ -35,10 +37,8 @@ public function testCanGetSupportedWithHelp(): void
}
}

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

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

use function count;
Expand All @@ -36,10 +38,8 @@ public function testCanGetSupportedWithHelp(): void
}
}

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

0 comments on commit 8522d6f

Please sign in to comment.