Skip to content

Commit e6f6132

Browse files
committed
Upgrade to PHPUnit 11
1 parent 6ee1706 commit e6f6132

187 files changed

Lines changed: 198 additions & 203 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/vendor
22
/composer.lock
3-
/.phpunit.result.cache
3+
/.phpunit.cache/
44

55
/tools/*
66
!/tools/ecs/composer.json

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"php": "^8.2"
1212
},
1313
"require-dev": {
14-
"phpunit/phpunit": "^9.0",
14+
"phpunit/phpunit": "^11.0",
1515
"php-coveralls/php-coveralls": "^2.0",
1616
"vimeo/psalm": "6.15.1"
1717
},

phpunit.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" colors="true" bootstrap="vendor/autoload.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" colors="true" bootstrap="vendor/autoload.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.5/phpunit.xsd" cacheDirectory=".phpunit.cache">
33
<testsuites>
44
<testsuite name="Postcode tests">
55
<directory>tests</directory>
6+
<exclude>tests/CountryPostcodeFormatterTest.php</exclude>
67
</testsuite>
78
</testsuites>
8-
<coverage processUncoveredFiles="true">
9+
<source>
910
<include>
1011
<directory suffix=".php">src</directory>
1112
</include>
12-
</coverage>
13+
</source>
1314
</phpunit>

tests/CountryPostcodeFormatterTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,21 @@
55
namespace Brick\Postcode\Tests;
66

77
use Brick\Postcode\CountryPostcodeFormatter;
8+
use PHPUnit\Framework\Attributes\DataProvider;
89
use PHPUnit\Framework\TestCase;
910

1011
/**
1112
* Base class for individual country postcode formatter tests.
1213
*/
1314
abstract class CountryPostcodeFormatterTest extends TestCase
1415
{
15-
/**
16-
* @dataProvider providerFormat
17-
*/
16+
#[DataProvider('providerFormat')]
1817
public function testFormat(string $input, ?string $expectedOutput): void
1918
{
2019
self::assertSame($expectedOutput, $this->getFormatter()->format($input));
2120
}
2221

23-
abstract public function providerFormat(): array;
22+
abstract public static function providerFormat(): array;
2423

2524
abstract protected function getFormatter(): CountryPostcodeFormatter;
2625
}

tests/Formatter/ADFormatterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414
class ADFormatterTest extends CountryPostcodeFormatterTest
1515
{
16-
public function providerFormat(): array
16+
public static function providerFormat(): array
1717
{
1818
return [
1919
['', null],

tests/Formatter/AFFormatterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414
class AFFormatterTest extends CountryPostcodeFormatterTest
1515
{
16-
public function providerFormat(): array
16+
public static function providerFormat(): array
1717
{
1818
return [
1919
['', null],

tests/Formatter/AIFormatterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414
class AIFormatterTest extends CountryPostcodeFormatterTest
1515
{
16-
public function providerFormat(): array
16+
public static function providerFormat(): array
1717
{
1818
return [
1919
['', null],

tests/Formatter/ALFormatterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414
class ALFormatterTest extends CountryPostcodeFormatterTest
1515
{
16-
public function providerFormat(): array
16+
public static function providerFormat(): array
1717
{
1818
return [
1919
['', null],

tests/Formatter/AMFormatterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414
class AMFormatterTest extends CountryPostcodeFormatterTest
1515
{
16-
public function providerFormat(): array
16+
public static function providerFormat(): array
1717
{
1818
return [
1919
['', null],

tests/Formatter/AQFormatterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414
class AQFormatterTest extends CountryPostcodeFormatterTest
1515
{
16-
public function providerFormat(): array
16+
public static function providerFormat(): array
1717
{
1818
return [
1919
['', null],

0 commit comments

Comments
 (0)