Update to Drupal 8.0.2. For more information, see https://www.drupal.org/drupal-8.0.2-release-notes
This commit is contained in:
parent
1a0e9d9fac
commit
a6b049dd05
538 changed files with 5247 additions and 1594 deletions
|
@ -27,22 +27,6 @@ class Date extends NumericDate {
|
|||
return "$this->tableAlias.$this->realField";
|
||||
}
|
||||
|
||||
/**
|
||||
* Override query to provide 'second' granularity.
|
||||
*/
|
||||
public function query() {
|
||||
$this->ensureMyTable();
|
||||
switch ($this->options['granularity']) {
|
||||
case 'second':
|
||||
$formula = $this->getDateFormat('YmdHis');
|
||||
$this->query->addOrderBy(NULL, $formula, $this->options['order'], $this->tableAlias . '_' . $this->field . '_' . $this->options['granularity']);
|
||||
return;
|
||||
}
|
||||
|
||||
// All other granularities are handled by the numeric sort handler.
|
||||
parent::query();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
|
|
|
@ -24,7 +24,7 @@ class ArgumentDateTimeTest extends DateTimeHandlerTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setUp() {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
// Add some basic test nodes.
|
||||
|
|
|
@ -40,7 +40,7 @@ abstract class DateTimeHandlerTestBase extends HandlerTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setUp() {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
// Add a date field to page nodes.
|
||||
|
|
|
@ -32,7 +32,7 @@ class FilterDateTest extends DateTimeHandlerTestBase {
|
|||
*
|
||||
* Create nodes with relative dates of yesterday, today, and tomorrow.
|
||||
*/
|
||||
public function setUp() {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
// Set to 'today'.
|
||||
|
|
|
@ -34,7 +34,7 @@ class FilterDateTimeTest extends DateTimeHandlerTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setUp() {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
static::$date = REQUEST_TIME + 86400;
|
||||
|
|
|
@ -24,7 +24,7 @@ class SortDateTimeTest extends DateTimeHandlerTestBase {
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setUp() {
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
// Add some basic test nodes.
|
||||
|
@ -33,6 +33,9 @@ class SortDateTimeTest extends DateTimeHandlerTestBase {
|
|||
'2000-10-10T00:01:00',
|
||||
'2000-10-10T00:02:00',
|
||||
'2000-10-10T00:03:00',
|
||||
'2000-10-10T00:03:02',
|
||||
'2000-10-10T00:03:01',
|
||||
'2000-10-10T00:03:03',
|
||||
];
|
||||
foreach ($dates as $date) {
|
||||
$this->nodes[] = $this->drupalCreateNode([
|
||||
|
@ -50,7 +53,8 @@ class SortDateTimeTest extends DateTimeHandlerTestBase {
|
|||
$field = static::$field_name . '_value';
|
||||
$view = Views::getView('test_sort_datetime');
|
||||
|
||||
// Sort order is DESC.
|
||||
// Set granularity to 'minute', and the secondary node ID order should
|
||||
// define the order of nodes with the same minute.
|
||||
$view->initHandlers();
|
||||
$view->sort[$field]->options['granularity'] = 'minute';
|
||||
$view->setDisplay('default');
|
||||
|
@ -58,6 +62,9 @@ class SortDateTimeTest extends DateTimeHandlerTestBase {
|
|||
$expected_result = [
|
||||
['nid' => $this->nodes[0]->id()],
|
||||
['nid' => $this->nodes[3]->id()],
|
||||
['nid' => $this->nodes[4]->id()],
|
||||
['nid' => $this->nodes[5]->id()],
|
||||
['nid' => $this->nodes[6]->id()],
|
||||
['nid' => $this->nodes[2]->id()],
|
||||
['nid' => $this->nodes[1]->id()],
|
||||
];
|
||||
|
@ -74,6 +81,9 @@ class SortDateTimeTest extends DateTimeHandlerTestBase {
|
|||
['nid' => $this->nodes[1]->id()],
|
||||
['nid' => $this->nodes[2]->id()],
|
||||
['nid' => $this->nodes[3]->id()],
|
||||
['nid' => $this->nodes[5]->id()],
|
||||
['nid' => $this->nodes[4]->id()],
|
||||
['nid' => $this->nodes[6]->id()],
|
||||
['nid' => $this->nodes[0]->id()],
|
||||
];
|
||||
$this->assertIdenticalResultset($view, $expected_result, $this->map);
|
||||
|
@ -91,6 +101,27 @@ class SortDateTimeTest extends DateTimeHandlerTestBase {
|
|||
['nid' => $this->nodes[1]->id()],
|
||||
['nid' => $this->nodes[2]->id()],
|
||||
['nid' => $this->nodes[3]->id()],
|
||||
['nid' => $this->nodes[4]->id()],
|
||||
['nid' => $this->nodes[5]->id()],
|
||||
['nid' => $this->nodes[6]->id()],
|
||||
];
|
||||
$this->assertIdenticalResultset($view, $expected_result, $this->map);
|
||||
$view->destroy();
|
||||
|
||||
// Change granularity to 'second'.
|
||||
$view->initHandlers();
|
||||
$view->sort[$field]->options['granularity'] = 'second';
|
||||
$view->sort[$field]->options['order'] = 'DESC';
|
||||
$view->setDisplay('default');
|
||||
$this->executeView($view);
|
||||
$expected_result = [
|
||||
['nid' => $this->nodes[0]->id()],
|
||||
['nid' => $this->nodes[6]->id()],
|
||||
['nid' => $this->nodes[4]->id()],
|
||||
['nid' => $this->nodes[5]->id()],
|
||||
['nid' => $this->nodes[3]->id()],
|
||||
['nid' => $this->nodes[2]->id()],
|
||||
['nid' => $this->nodes[1]->id()],
|
||||
];
|
||||
$this->assertIdenticalResultset($view, $expected_result, $this->map);
|
||||
$view->destroy();
|
||||
|
|
Reference in a new issue