public function DisplayTest::testGetAttachedDisplays in Drupal 8
Same name and namespace in other branches
- 9 core/modules/views/tests/src/Functional/Plugin/DisplayTest.php \Drupal\Tests\views\Functional\Plugin\DisplayTest::testGetAttachedDisplays()
Tests the getAttachedDisplays method.
File
- core/modules/ views/ tests/ src/ Functional/ Plugin/ DisplayTest.php, line 164 
Class
- DisplayTest
- Tests the basic display plugin.
Namespace
Drupal\Tests\views\Functional\PluginCode
public function testGetAttachedDisplays() {
  $view = Views::getView('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(), [
    'feed_1',
    'feed_2',
  ]);
  $view
    ->setDisplay('feed_1');
  $this
    ->assertEqual($view->display_handler
    ->getAttachedDisplays(), []);
}