protected function LayoutBuilderTest::assertCorrectLayouts in Drupal 10
Same name and namespace in other branches
- 8 core/modules/layout_builder/tests/src/Functional/LayoutBuilderTest.php \Drupal\Tests\layout_builder\Functional\LayoutBuilderTest::assertCorrectLayouts()
- 9 core/modules/layout_builder/tests/src/Functional/LayoutBuilderTest.php \Drupal\Tests\layout_builder\Functional\LayoutBuilderTest::assertCorrectLayouts()
Asserts that the correct layouts are available.
@internal
File
- core/
modules/ layout_builder/ tests/ src/ Functional/ LayoutBuilderTest.php, line 1515
Class
- LayoutBuilderTest
- Tests the Layout Builder UI.
Namespace
Drupal\Tests\layout_builder\FunctionalCode
protected function assertCorrectLayouts() : void {
$assert_session = $this
->assertSession();
// Ensure the layouts provided by layout_builder are available.
$expected_layouts_hrefs = [
'layout_builder/configure/section/overrides/node.1/0/layout_onecol',
'layout_builder/configure/section/overrides/node.1/0/layout_twocol_section',
'layout_builder/configure/section/overrides/node.1/0/layout_threecol_section',
'layout_builder/configure/section/overrides/node.1/0/layout_fourcol_section',
];
foreach ($expected_layouts_hrefs as $expected_layouts_href) {
$assert_session
->linkByHrefExists($expected_layouts_href);
}
// Ensure the layout_discovery module's layouts were removed.
$unexpected_layouts = [
'twocol',
'twocol_bricks',
'threecol_25_50_25',
'threecol_33_34_33',
];
foreach ($unexpected_layouts as $unexpected_layout) {
$assert_session
->linkByHrefNotExists("layout_builder/add/section/overrides/node.1/0/{$unexpected_layout}");
$assert_session
->linkByHrefNotExists("layout_builder/configure/section/overrides/node.1/0/{$unexpected_layout}");
}
}