You are here

public function DisplayTest::testDisplayAreas in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/views_ui/src/Tests/DisplayTest.php \Drupal\views_ui\Tests\DisplayTest::testDisplayAreas()

Tests display areas.

File

core/modules/views_ui/src/Tests/DisplayTest.php, line 133
Contains \Drupal\views_ui\Tests\DisplayTest.

Class

DisplayTest
Tests the display UI.

Namespace

Drupal\views_ui\Tests

Code

public function testDisplayAreas() {

  // Show the advanced column.
  $this
    ->config('views.settings')
    ->set('ui.show.advanced_column', TRUE)
    ->save();

  // Add a new data display to the view.
  $view = Views::getView('test_display');
  $view->storage
    ->addDisplay('display_no_area_test');
  $view
    ->save();
  $this
    ->drupalGet('admin/structure/views/view/test_display/edit/display_no_area_test_1');
  $areas = array(
    'header',
    'footer',
    'empty',
  );

  // Assert that the expected text is found in each area category.
  foreach ($areas as $type) {
    $element = $this
      ->xpath('//div[contains(@class, :class)]/div', array(
      ':class' => $type,
    ));
    $this
      ->assertEqual((string) $element[0], SafeMarkup::format('The selected display type does not use @type plugins', array(
      '@type' => $type,
    )));
  }
}