|
24 | 24 | use Symbiote\GridFieldExtensions\Tests\Stub\ThroughIntermediary; |
25 | 25 | use Symbiote\GridFieldExtensions\Tests\Stub\TitleObject; |
26 | 26 | use Symbiote\GridFieldExtensions\Tests\Stub\TitleSortedObject; |
| 27 | +use Symbiote\GridFieldExtensions\Tests\Stub\TitleArraySortedObject; |
27 | 28 | use Symbiote\GridFieldExtensions\Tests\Stub\ThroughIntermediaryVersioned; |
28 | 29 |
|
29 | 30 | /** |
@@ -53,6 +54,7 @@ class GridFieldOrderableRowsTest extends SapphireTest |
53 | 54 | ThroughBelongs::class, |
54 | 55 | TitleObject::class, |
55 | 56 | TitleSortedObject::class, |
| 57 | + TitleArraySortedObject::class, |
56 | 58 | ThroughDefinerVersioned::class, |
57 | 59 | ThroughIntermediaryVersioned::class, |
58 | 60 | ThroughBelongsVersioned::class, |
@@ -332,6 +334,17 @@ public function testGetManipulatedDataWithDefaultSort() |
332 | 334 | $this->assertSame(['B', 'A', 'C'], $sortedList->column('Iden')); |
333 | 335 | } |
334 | 336 |
|
| 337 | + |
| 338 | + public function testGetManipulatedDataWithDefaultSortArray() |
| 339 | + { |
| 340 | + $sortedList = $this->getTitleSortedListForManipuatedData(TitleArraySortedObject::class, [ |
| 341 | + ['Title' => 'X', 'Iden' => 'C', 'OtherSort' => 3], |
| 342 | + ['Title' => 'Z', 'Iden' => 'A', 'OtherSort' => 2], |
| 343 | + ['Title' => 'Z', 'Iden' => 'B', 'OtherSort' => 1], |
| 344 | + ]); |
| 345 | + $this->assertSame(['C', 'B', 'A'], $sortedList->column('Iden')); |
| 346 | + } |
| 347 | + |
335 | 348 | private function getTitleSortedListForManipuatedData(string $dataClass, array $data): DataList |
336 | 349 | { |
337 | 350 | $list = new DataList($dataClass); |
|
0 commit comments