mirror of
https://github.com/symbiote/silverstripe-gridfieldextensions.git
synced 2024-10-22 17:05:39 +02:00
Merge pull request #416 from creative-commoners/pulls/5/phpunit11
DEP Use PHPUnit 11
This commit is contained in:
commit
ac1a5eedf5
@ -30,7 +30,7 @@
|
|||||||
"silverstripe/framework": "^6"
|
"silverstripe/framework": "^6"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "^9.6",
|
"phpunit/phpunit": "^11.3",
|
||||||
"squizlabs/php_codesniffer": "^3.7",
|
"squizlabs/php_codesniffer": "^3.7",
|
||||||
"silverstripe/versioned": "^3",
|
"silverstripe/versioned": "^3",
|
||||||
"silverstripe/standards": "^1",
|
"silverstripe/standards": "^1",
|
||||||
|
@ -27,6 +27,7 @@ use Symbiote\GridFieldExtensions\Tests\Stub\TitleObject;
|
|||||||
use Symbiote\GridFieldExtensions\Tests\Stub\TitleSortedObject;
|
use Symbiote\GridFieldExtensions\Tests\Stub\TitleSortedObject;
|
||||||
use Symbiote\GridFieldExtensions\Tests\Stub\TitleArraySortedObject;
|
use Symbiote\GridFieldExtensions\Tests\Stub\TitleArraySortedObject;
|
||||||
use Symbiote\GridFieldExtensions\Tests\Stub\ThroughIntermediaryVersioned;
|
use Symbiote\GridFieldExtensions\Tests\Stub\ThroughIntermediaryVersioned;
|
||||||
|
use PHPUnit\Framework\Attributes\DataProvider;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for the {@link GridFieldOrderableRows} component.
|
* Tests for the {@link GridFieldOrderableRows} component.
|
||||||
@ -61,7 +62,7 @@ class GridFieldOrderableRowsTest extends SapphireTest
|
|||||||
ThroughBelongsVersioned::class,
|
ThroughBelongsVersioned::class,
|
||||||
];
|
];
|
||||||
|
|
||||||
public function reorderItemsProvider()
|
public static function reorderItemsProvider()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
[StubParent::class . '.parent', 'MyHasMany', 'Sort'],
|
[StubParent::class . '.parent', 'MyHasMany', 'Sort'],
|
||||||
@ -75,9 +76,7 @@ class GridFieldOrderableRowsTest extends SapphireTest
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
#[DataProvider('reorderItemsProvider')]
|
||||||
* @dataProvider reorderItemsProvider
|
|
||||||
*/
|
|
||||||
public function testReorderItems($fixtureID, $relationName, $sortName)
|
public function testReorderItems($fixtureID, $relationName, $sortName)
|
||||||
{
|
{
|
||||||
$orderable = new GridFieldOrderableRows($sortName);
|
$orderable = new GridFieldOrderableRows($sortName);
|
||||||
@ -212,9 +211,6 @@ class GridFieldOrderableRowsTest extends SapphireTest
|
|||||||
$this->assertEquals($desiredOrder, $newOrder);
|
$this->assertEquals($desiredOrder, $newOrder);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers \Symbiote\GridFieldExtensions\GridFieldOrderableRows::getSortTable
|
|
||||||
*/
|
|
||||||
public function testGetSortTable()
|
public function testGetSortTable()
|
||||||
{
|
{
|
||||||
$orderable = new GridFieldOrderableRows();
|
$orderable = new GridFieldOrderableRows();
|
||||||
@ -315,9 +311,7 @@ class GridFieldOrderableRowsTest extends SapphireTest
|
|||||||
$this->assertTrue($differenceFound);
|
$this->assertTrue($differenceFound);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
#[DataProvider('provideGetManipulatedData')]
|
||||||
* @dataProvider provideGetManipulatedData
|
|
||||||
*/
|
|
||||||
public function testGetManipulatedData(string $dataClass, string $listClass, array $data, array $expected)
|
public function testGetManipulatedData(string $dataClass, string $listClass, array $data, array $expected)
|
||||||
{
|
{
|
||||||
$list = $listClass == DataList::class ? new DataList($dataClass) : new ArrayList();
|
$list = $listClass == DataList::class ? new DataList($dataClass) : new ArrayList();
|
||||||
@ -336,7 +330,7 @@ class GridFieldOrderableRowsTest extends SapphireTest
|
|||||||
$this->assertSame($expected, $sortedList->column($col));
|
$this->assertSame($expected, $sortedList->column($col));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function provideGetManipulatedData(): array
|
public static function provideGetManipulatedData(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
[
|
[
|
||||||
|
Loading…
Reference in New Issue
Block a user