‪TYPO3CMS  11.5
PlainDataResolverTest.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
22 
24 {
26  'typo3/sysext/core/Tests/Functional/Fixtures/Extensions/irre_tutorial',
27  ];
28 
29  protected function ‪setUp(): void
30  {
31  parent::setUp();
32  $this->importCSVDataSet(__DIR__ . '/DataSet/Pages.csv');
33  }
34 
44  public function ‪sortingDataProvider(): array
45  {
46  return [
47  'sorting' => [
48  [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
49  [1, 2, 10, 3, 4, 5, 8, 7, 6, 9],
50  ['sorting'],
51  ],
52  'sorting asc' => [
53  [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
54  [1, 2, 10, 3, 4, 5, 8, 7, 6, 9],
55  ['sorting asc'],
56  ],
57  'sorting desc' => [
58  [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
59  [9, 6, 7, 8, 5, 4, 3, 10, 2, 1],
60  ['sorting desc'],
61  ],
62  'sorting ASC' => [
63  [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
64  [1, 2, 10, 3, 4, 5, 8, 7, 6, 9],
65  ['sorting ASC'],
66  ],
67  'sorting DESC' => [
68  [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
69  [9, 6, 7, 8, 5, 4, 3, 10, 2, 1],
70  ['sorting DESC'],
71  ],
72  'sorting ASC title' => [
73  [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
74  [1, 2, 10, 3, 4, 5, 8, 7, 6, 9],
75  ['sorting ASC', 'title'],
76  ],
77  'sorting ASC title asc' => [
78  [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
79  [1, 2, 10, 3, 4, 5, 8, 7, 6, 9],
80  ['sorting ASC', 'title asc'],
81  ],
82  'sorting ASC title desc' => [
83  [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
84  [1, 2, 10, 3, 4, 5, 8, 7, 6, 9],
85  ['sorting ASC', 'title desc'],
86  ],
87  'sorting ASC title ASC' => [
88  [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
89  [1, 2, 10, 3, 4, 5, 8, 7, 6, 9],
90  ['sorting ASC', 'title ASC'],
91  ],
92  'sorting ASC title DESC' => [
93  [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
94  [1, 2, 10, 3, 4, 5, 8, 7, 6, 9],
95  ['sorting ASC', 'title DESC'],
96  ],
97  'title sorting ASC' => [
98  [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
99  [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
100  ['title', 'sorting ASC'],
101  ],
102  'title asc sorting ASC' => [
103  [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
104  [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
105  ['title asc', 'sorting ASC'],
106  ],
107  'title desc sorting ASC' => [
108  [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
109  [10, 9, 8, 7, 6, 5, 4, 3, 2, 1],
110  ['title desc', 'sorting ASC'],
111  ],
112  'title ASC sorting ASC' => [
113  [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
114  [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
115  ['title ASC', 'sorting ASC'],
116  ],
117  'title DESC sorting ASC' => [
118  [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
119  [10, 9, 8, 7, 6, 5, 4, 3, 2, 1],
120  ['title DESC', 'sorting ASC'],
121  ],
122  ];
123  }
124 
129  public function ‪processSortingReturnsExpectedSequenceOfUids(array $input, array $expected, array $sortings): void
130  {
131  $subject = new ‪PlainDataResolver('pages', [], $sortings);
132  self::assertSame($expected, $subject->processSorting($input));
133  }
134 }
‪TYPO3\CMS\Core\DataHandling\PlainDataResolver
Definition: PlainDataResolver.php:34
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\DataResolving\PlainDataResolverTest
Definition: PlainDataResolverTest.php:24
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase
Definition: AbstractDataHandlerActionTestCase.php:41
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\DataResolving\PlainDataResolverTest\setUp
‪setUp()
Definition: PlainDataResolverTest.php:29
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\DataResolving\PlainDataResolverTest\$testExtensionsToLoad
‪$testExtensionsToLoad
Definition: PlainDataResolverTest.php:25
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\DataResolving\PlainDataResolverTest\processSortingReturnsExpectedSequenceOfUids
‪processSortingReturnsExpectedSequenceOfUids(array $input, array $expected, array $sortings)
Definition: PlainDataResolverTest.php:129
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\DataResolving\PlainDataResolverTest\sortingDataProvider
‪array sortingDataProvider()
Definition: PlainDataResolverTest.php:44
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\DataResolving
Definition: PlainDataResolverTest.php:18