Skip to content

Commit d4c17da

Browse files
committed
Upgrade phpunit
1 parent 21e5b10 commit d4c17da

File tree

2 files changed

+9
-16
lines changed

2 files changed

+9
-16
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"require-dev": {
2828
"friendsofphp/php-cs-fixer": "^3.0",
2929
"phpstan/phpstan": "^1.9",
30-
"phpunit/phpunit": "^9.5"
30+
"phpunit/phpunit": "^10"
3131
},
3232
"config": {
3333
"sort-packages": true

tests/ScalarValuesTest.php

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,12 @@
1414
namespace Ecommit\ScalarValues\Tests;
1515

1616
use Ecommit\ScalarValues\ScalarValues;
17+
use PHPUnit\Framework\Attributes\DataProvider;
1718
use PHPUnit\Framework\TestCase;
1819

1920
class ScalarValuesTest extends TestCase
2021
{
21-
/**
22-
* @dataProvider getTestContainsOnlyScalarValuesProdiver
23-
*/
22+
#[DataProvider('getTestContainsOnlyScalarValuesProdiver')]
2423
public function testContainsOnlyScalarValues(array $input, bool $expected): void
2524
{
2625
$this->assertEquals(
@@ -29,7 +28,7 @@ public function testContainsOnlyScalarValues(array $input, bool $expected): void
2928
);
3029
}
3130

32-
public function getTestContainsOnlyScalarValuesProdiver(): array
31+
public static function getTestContainsOnlyScalarValuesProdiver(): array
3332
{
3433
// Colonne 1: Input
3534
// Colonne 2: Expected result
@@ -48,16 +47,14 @@ public function getTestContainsOnlyScalarValuesProdiver(): array
4847
];
4948
}
5049

51-
/**
52-
* @dataProvider getNotArrayInputProdiver
53-
*/
50+
#[DataProvider('getNotArrayInputProdiver')]
5451
public function testContainsOnlyScalarValuesInputError(mixed $input): void
5552
{
5653
$this->expectException(\TypeError::class);
5754
ScalarValues::containsOnlyScalarValues($input); // @phpstan-ignore-line
5855
}
5956

60-
public function getNotArrayInputProdiver(): array
57+
public static function getNotArrayInputProdiver(): array
6158
{
6259
return [
6360
[null],
@@ -68,9 +65,7 @@ public function getNotArrayInputProdiver(): array
6865
];
6966
}
7067

71-
/**
72-
* @dataProvider getTestFilterScalarValuesProdiver
73-
*/
68+
#[DataProvider('getTestFilterScalarValuesProdiver')]
7469
public function testFilterScalarValues(array $input, array $expected): void
7570
{
7671
$this->assertEquals(
@@ -79,7 +74,7 @@ public function testFilterScalarValues(array $input, array $expected): void
7974
);
8075
}
8176

82-
public function getTestFilterScalarValuesProdiver(): array
77+
public static function getTestFilterScalarValuesProdiver(): array
8378
{
8479
// Colonne 1: Input
8580
// Colonne 2: Expected result
@@ -98,9 +93,7 @@ public function getTestFilterScalarValuesProdiver(): array
9893
];
9994
}
10095

101-
/**
102-
* @dataProvider getNotArrayInputProdiver
103-
*/
96+
#[DataProvider('getNotArrayInputProdiver')]
10497
public function testFilterScalarValuesInputError(mixed $input): void
10598
{
10699
$this->expectException(\TypeError::class);

0 commit comments

Comments
 (0)