1 date_views.test public DateViewsTestCase::testDateViewsPagerPlugin()

Test the date views pager plugin.

File

core/modules/date/tests/date_views.test, line 145
Tests date popup in Views

Class

DateViewsTestCase

Code

public function testDateViewsPagerPlugin() {
  $this->backdropCreateNode();
  // The view date_views_pager_test ships with the views_test module.
  $this->backdropGet('date-views-pager-test');
  $format = config_get('date_views.settings', 'date_views_month_format_with_year');
  $expected_heading = format_date(time(), 'custom', $format);
  $this->assertText($expected_heading, 'Date pager shows the expected heading');
  $this->assertLink('« Prev');
  $this->assertLink('Next »');
  // Change the date format setting to show the short month name.
  $format = 'M Y';
  config_set('date_views.settings', 'date_views_month_format_with_year', $format);
  $this->backdropGet('date-views-pager-test');
  $expected_heading = format_date(time(), 'custom', $format);
  $this->assertText($expected_heading, 'Date pager shows the expected heading after changing the format');
}