function SortDateTest::expectedResultSet
Same name in other branches
- 9 core/modules/views/tests/src/Kernel/Handler/SortDateTest.php \Drupal\Tests\views\Kernel\Handler\SortDateTest::expectedResultSet()
- 10 core/modules/views/tests/src/Kernel/Handler/SortDateTest.php \Drupal\Tests\views\Kernel\Handler\SortDateTest::expectedResultSet()
- 11.x core/modules/views/tests/src/Kernel/Handler/SortDateTest.php \Drupal\Tests\views\Kernel\Handler\SortDateTest::expectedResultSet()
1 call to SortDateTest::expectedResultSet()
- SortDateTest::testDateOrdering in core/
modules/ views/ tests/ src/ Kernel/ Handler/ SortDateTest.php - Tests numeric ordering of the result set.
File
-
core/
modules/ views/ tests/ src/ Kernel/ Handler/ SortDateTest.php, line 23
Class
- SortDateTest
- Tests for core Drupal\views\Plugin\views\sort\Date handler.
Namespace
Drupal\Tests\views\Kernel\HandlerCode
protected function expectedResultSet($granularity, $reverse = TRUE) {
$expected = [];
if (!$reverse) {
switch ($granularity) {
case 'second':
$expected = [
[
'name' => 'John',
],
[
'name' => 'Paul',
],
[
'name' => 'Meredith',
],
[
'name' => 'Ringo',
],
[
'name' => 'George',
],
];
break;
case 'minute':
$expected = [
[
'name' => 'John',
],
[
'name' => 'Paul',
],
[
'name' => 'Ringo',
],
[
'name' => 'Meredith',
],
[
'name' => 'George',
],
];
break;
case 'hour':
$expected = [
[
'name' => 'John',
],
[
'name' => 'Ringo',
],
[
'name' => 'Paul',
],
[
'name' => 'Meredith',
],
[
'name' => 'George',
],
];
break;
case 'day':
$expected = [
[
'name' => 'John',
],
[
'name' => 'Ringo',
],
[
'name' => 'Paul',
],
[
'name' => 'Meredith',
],
[
'name' => 'George',
],
];
break;
case 'month':
$expected = [
[
'name' => 'John',
],
[
'name' => 'George',
],
[
'name' => 'Ringo',
],
[
'name' => 'Paul',
],
[
'name' => 'Meredith',
],
];
break;
case 'year':
$expected = [
[
'name' => 'John',
],
[
'name' => 'George',
],
[
'name' => 'Ringo',
],
[
'name' => 'Paul',
],
[
'name' => 'Meredith',
],
];
break;
}
}
else {
switch ($granularity) {
case 'second':
$expected = [
[
'name' => 'George',
],
[
'name' => 'Ringo',
],
[
'name' => 'Meredith',
],
[
'name' => 'Paul',
],
[
'name' => 'John',
],
];
break;
case 'minute':
$expected = [
[
'name' => 'George',
],
[
'name' => 'Ringo',
],
[
'name' => 'Meredith',
],
[
'name' => 'Paul',
],
[
'name' => 'John',
],
];
break;
case 'hour':
$expected = [
[
'name' => 'George',
],
[
'name' => 'Ringo',
],
[
'name' => 'Paul',
],
[
'name' => 'Meredith',
],
[
'name' => 'John',
],
];
break;
case 'day':
$expected = [
[
'name' => 'George',
],
[
'name' => 'John',
],
[
'name' => 'Ringo',
],
[
'name' => 'Paul',
],
[
'name' => 'Meredith',
],
];
break;
case 'month':
$expected = [
[
'name' => 'John',
],
[
'name' => 'George',
],
[
'name' => 'Ringo',
],
[
'name' => 'Paul',
],
[
'name' => 'Meredith',
],
];
break;
case 'year':
$expected = [
[
'name' => 'John',
],
[
'name' => 'George',
],
[
'name' => 'Ringo',
],
[
'name' => 'Paul',
],
[
'name' => 'Meredith',
],
];
break;
}
}
return $expected;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.