function LayoutBuilderViewModeTest::testFullViewModeMultipleBundles
Same name and namespace in other branches
- 11.x core/modules/layout_builder/tests/src/Functional/LayoutBuilderViewModeTest.php \Drupal\Tests\layout_builder\Functional\LayoutBuilderViewModeTest::testFullViewModeMultipleBundles()
- 10 core/modules/layout_builder/tests/src/Functional/LayoutBuilderViewModeTest.php \Drupal\Tests\layout_builder\Functional\LayoutBuilderViewModeTest::testFullViewModeMultipleBundles()
Ensures that one bundle doesn't interfere with another bundle.
File
-
core/
modules/ layout_builder/ tests/ src/ Functional/ LayoutBuilderViewModeTest.php, line 288
Class
- LayoutBuilderViewModeTest
- Tests the Layout Builder UI with view modes.
Namespace
Drupal\Tests\layout_builder\FunctionalCode
public function testFullViewModeMultipleBundles() : void {
$assert_session = $this->assertSession();
$page = $this->getSession()
->getPage();
$this->drupalLogin($this->drupalCreateUser([
'configure any layout',
'administer node display',
]));
// Create one bundle with the full view mode enabled.
$this->createContentType([
'type' => 'full_bundle',
]);
$this->drupalGet('admin/structure/types/manage/full_bundle/display');
$page = $this->getSession()
->getPage();
$enable_link = $page->find('xpath', "//tr[@id='display-mode-node-full-bundle-full']//a[contains(., 'Enable')]");
$this->assertNotNull($enable_link, 'Enable link should exist for the full view mode on full_bundle.');
$enable_link->click();
// Create another bundle without the full view mode enabled.
$this->createContentType([
'type' => 'default_bundle',
]);
$this->drupalGet('admin/structure/types/manage/default_bundle/display/default');
$this->submitForm([
'layout[enabled]' => TRUE,
], 'Save');
$this->drupalGet('admin/structure/types/manage/default_bundle/display/default');
$this->submitForm([
'layout[allow_custom]' => TRUE,
], 'Save');
$this->drupalGet('admin/structure/types/manage/default_bundle/display/default');
$assert_session->checkboxChecked('layout[allow_custom]');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.