From e380198e60f73523c8ad91d996c4df41f26be804 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Tue, 10 Sep 2024 11:29:08 +1200 Subject: [PATCH] DEP Use PHPUnit 11 --- composer.json | 2 +- tests/GridFieldOrderableRowsTest.php | 16 +++++----------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/composer.json b/composer.json index fd48ca0..91f7b80 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "silverstripe/framework": "^6" }, "require-dev": { - "phpunit/phpunit": "^9.6", + "phpunit/phpunit": "^11.3", "squizlabs/php_codesniffer": "^3.7", "silverstripe/versioned": "^3", "silverstripe/standards": "^1", diff --git a/tests/GridFieldOrderableRowsTest.php b/tests/GridFieldOrderableRowsTest.php index 6cf438b..2d5d5d6 100644 --- a/tests/GridFieldOrderableRowsTest.php +++ b/tests/GridFieldOrderableRowsTest.php @@ -27,6 +27,7 @@ use Symbiote\GridFieldExtensions\Tests\Stub\TitleObject; use Symbiote\GridFieldExtensions\Tests\Stub\TitleSortedObject; use Symbiote\GridFieldExtensions\Tests\Stub\TitleArraySortedObject; use Symbiote\GridFieldExtensions\Tests\Stub\ThroughIntermediaryVersioned; +use PHPUnit\Framework\Attributes\DataProvider; /** * Tests for the {@link GridFieldOrderableRows} component. @@ -61,7 +62,7 @@ class GridFieldOrderableRowsTest extends SapphireTest ThroughBelongsVersioned::class, ]; - public function reorderItemsProvider() + public static function reorderItemsProvider() { return [ [StubParent::class . '.parent', 'MyHasMany', 'Sort'], @@ -75,9 +76,7 @@ class GridFieldOrderableRowsTest extends SapphireTest ]; } - /** - * @dataProvider reorderItemsProvider - */ + #[DataProvider('reorderItemsProvider')] public function testReorderItems($fixtureID, $relationName, $sortName) { $orderable = new GridFieldOrderableRows($sortName); @@ -212,9 +211,6 @@ class GridFieldOrderableRowsTest extends SapphireTest $this->assertEquals($desiredOrder, $newOrder); } - /** - * @covers \Symbiote\GridFieldExtensions\GridFieldOrderableRows::getSortTable - */ public function testGetSortTable() { $orderable = new GridFieldOrderableRows(); @@ -315,9 +311,7 @@ class GridFieldOrderableRowsTest extends SapphireTest $this->assertTrue($differenceFound); } - /** - * @dataProvider provideGetManipulatedData - */ + #[DataProvider('provideGetManipulatedData')] public function testGetManipulatedData(string $dataClass, string $listClass, array $data, array $expected) { $list = $listClass == DataList::class ? new DataList($dataClass) : new ArrayList(); @@ -336,7 +330,7 @@ class GridFieldOrderableRowsTest extends SapphireTest $this->assertSame($expected, $sortedList->column($col)); } - public function provideGetManipulatedData(): array + public static function provideGetManipulatedData(): array { return [ [