Revert "Issue #1960888 by tim.plunkett, dawehner, jibran, damiankloip: Fixed Default archive view uses wrong argument plugin."
This reverts commit fd7e482b11
.
8.0.x
parent
fd7e482b11
commit
6801679a0f
|
@ -278,7 +278,7 @@ function node_views_data() {
|
|||
),
|
||||
);
|
||||
|
||||
$data['node_field_data']['created_year_month'] = array(
|
||||
$data['node_field_data']['date_year_month'] = array(
|
||||
'title' => t('Created year + month'),
|
||||
'help' => t('Date in the form of YYYYMM.'),
|
||||
'argument' => array(
|
||||
|
|
|
@ -85,7 +85,7 @@ display:
|
|||
override: '1'
|
||||
items_per_page: '30'
|
||||
specify_validation: '1'
|
||||
plugin_id: date_year_month
|
||||
plugin_id: node_created_year_month
|
||||
filters:
|
||||
status:
|
||||
id: status
|
||||
|
|
|
@ -14,7 +14,7 @@ use Drupal\views\ViewExecutable;
|
|||
/**
|
||||
* Tests for views default views.
|
||||
*/
|
||||
class DefaultViewsTest extends ViewTestBase {
|
||||
class DefaultViewsTest extends WebTestBase {
|
||||
|
||||
/**
|
||||
* Modules to enable.
|
||||
|
@ -160,53 +160,4 @@ class DefaultViewsTest extends ViewTestBase {
|
|||
return $term;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the archive view.
|
||||
*/
|
||||
public function testArchiveView() {
|
||||
// Create additional nodes compared to the one in the setup method.
|
||||
// Create two nodes in the same month, and one in each following month.
|
||||
$node = array(
|
||||
'created' => 280299600, // Sun, 19 Nov 1978 05:00:00 GMT
|
||||
);
|
||||
$this->drupalCreateNode($node);
|
||||
$this->drupalCreateNode($node);
|
||||
$node = array(
|
||||
'created' => 282891600, // Tue, 19 Dec 1978 05:00:00 GMT
|
||||
);
|
||||
$this->drupalCreateNode($node);
|
||||
$node = array(
|
||||
'created' => 285570000, // Fri, 19 Jan 1979 05:00:00 GMT
|
||||
);
|
||||
$this->drupalCreateNode($node);
|
||||
|
||||
$view = views_get_view('archive');
|
||||
$view->setDisplay('page_1');
|
||||
$this->executeView($view);
|
||||
$column_map = drupal_map_assoc(array('nid', 'created_year_month', 'num_records'));
|
||||
$expected_result = array(
|
||||
array(
|
||||
'nid' => 1,
|
||||
'created_year_month' => 201305,
|
||||
'num_records' => 11,
|
||||
),
|
||||
array(
|
||||
'nid' => 15,
|
||||
'created_year_month' => 197901,
|
||||
'num_records' => 1,
|
||||
),
|
||||
array(
|
||||
'nid' => 14,
|
||||
'created_year_month' => 197812,
|
||||
'num_records' => 1,
|
||||
),
|
||||
array(
|
||||
'nid' => 12,
|
||||
'created_year_month' => 197811,
|
||||
'num_records' => 2,
|
||||
),
|
||||
);
|
||||
$this->assertIdenticalResultset($view, $expected_result, $column_map);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue