public function DisplayTest::testGetAttachedDisplays

Tests the getAttachedDisplays method.

File

drupal/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayTest.php, line 158
Definition of Drupal\views\Tests\Plugin\DisplayTest.

Class

DisplayTest
Tests the basic display plugin.

Namespace

Drupal\views\Tests\Plugin

Code

public function testGetAttachedDisplays() {
  $view = views_get_view('test_get_attach_displays');

  // Both the feed_1 and the feed_2 display are attached to the page display.
  $view
    ->setDisplay('page_1');
  $this
    ->assertEqual($view->display_handler
    ->getAttachedDisplays(), array(
    'feed_1',
    'feed_2',
  ));
  $view
    ->setDisplay('feed_1');
  $this
    ->assertEqual($view->display_handler
    ->getAttachedDisplays(), array());
}