Skip to content

Commit

Permalink
Merge pull request #416 from creative-commoners/pulls/5/phpunit11
Browse files Browse the repository at this point in the history
DEP Use PHPUnit 11
  • Loading branch information
GuySartorelli authored Sep 18, 2024
2 parents 4bbfa9d + e380198 commit ac1a5ee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
16 changes: 5 additions & 11 deletions tests/GridFieldOrderableRowsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
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.
Expand Down Expand Up @@ -61,7 +62,7 @@ class GridFieldOrderableRowsTest extends SapphireTest
ThroughBelongsVersioned::class,
];

public function reorderItemsProvider()
public static function reorderItemsProvider()
{
return [
[StubParent::class . '.parent', 'MyHasMany', 'Sort'],
Expand All @@ -75,9 +76,7 @@ public function reorderItemsProvider()
];
}

/**
* @dataProvider reorderItemsProvider
*/
#[DataProvider('reorderItemsProvider')]
public function testReorderItems($fixtureID, $relationName, $sortName)
{
$orderable = new GridFieldOrderableRows($sortName);
Expand Down Expand Up @@ -212,9 +211,6 @@ public function testSortableChildClass()
$this->assertEquals($desiredOrder, $newOrder);
}

/**
* @covers \Symbiote\GridFieldExtensions\GridFieldOrderableRows::getSortTable
*/
public function testGetSortTable()
{
$orderable = new GridFieldOrderableRows();
Expand Down Expand Up @@ -315,9 +311,7 @@ public function testReorderItemsSubclassVersioned()
$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();
Expand All @@ -336,7 +330,7 @@ public function testGetManipulatedData(string $dataClass, string $listClass, arr
$this->assertSame($expected, $sortedList->column($col));
}

public function provideGetManipulatedData(): array
public static function provideGetManipulatedData(): array
{
return [
[
Expand Down

0 comments on commit ac1a5ee

Please sign in to comment.