function LayoutBuilderAccessTest::assertExpectedAccess
Same name in other branches
- 9 core/modules/layout_builder/tests/src/Functional/LayoutBuilderAccessTest.php \Drupal\Tests\layout_builder\Functional\LayoutBuilderAccessTest::assertExpectedAccess()
- 8.9.x core/modules/layout_builder/tests/src/Functional/LayoutBuilderAccessTest.php \Drupal\Tests\layout_builder\Functional\LayoutBuilderAccessTest::assertExpectedAccess()
- 11.x core/modules/layout_builder/tests/src/Functional/LayoutBuilderAccessTest.php \Drupal\Tests\layout_builder\Functional\LayoutBuilderAccessTest::assertExpectedAccess()
Asserts the correct response code is returned based on expected access.
Parameters
bool $expected_access: The expected access.
2 calls to LayoutBuilderAccessTest::assertExpectedAccess()
- LayoutBuilderAccessTest::testAccessWithBundles in core/
modules/ layout_builder/ tests/ src/ Functional/ LayoutBuilderAccessTest.php - Tests Layout Builder access for an entity type that has bundles.
- LayoutBuilderAccessTest::testAccessWithoutBundles in core/
modules/ layout_builder/ tests/ src/ Functional/ LayoutBuilderAccessTest.php - Tests Layout Builder access for an entity type that does not have bundles.
File
-
core/
modules/ layout_builder/ tests/ src/ Functional/ LayoutBuilderAccessTest.php, line 285
Class
- LayoutBuilderAccessTest
- Tests access to Layout Builder.
Namespace
Drupal\Tests\layout_builder\FunctionalCode
private function assertExpectedAccess(bool $expected_access) : void {
$expected_status_code = $expected_access ? 200 : 403;
$this->assertSession()
->statusCodeEquals($expected_status_code);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.