function DisplayTest::testGetAttachedDisplays
Same name in other branches
- 9 core/modules/views/tests/src/Functional/Plugin/DisplayTest.php \Drupal\Tests\views\Functional\Plugin\DisplayTest::testGetAttachedDisplays()
- 8.9.x core/modules/views/tests/src/Functional/Plugin/DisplayTest.php \Drupal\Tests\views\Functional\Plugin\DisplayTest::testGetAttachedDisplays()
- 11.x 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 181
Class
- DisplayTest
- Tests the basic display plugin.
Namespace
Drupal\Tests\views\Functional\PluginCode
public function testGetAttachedDisplays() : void {
$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->assertEquals([
'feed_1',
'feed_2',
], $view->display_handler
->getAttachedDisplays());
$view->setDisplay('feed_1');
$this->assertEquals([], $view->display_handler
->getAttachedDisplays());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.