You are here

private function LayoutBuilderAccessTest::assertExpectedAccess in Drupal 9

Same name and namespace in other branches
  1. 8 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 282

Class

LayoutBuilderAccessTest
Tests access to Layout Builder.

Namespace

Drupal\Tests\layout_builder\Functional

Code

private function assertExpectedAccess($expected_access) {
  $expected_status_code = $expected_access ? 200 : 403;
  $this
    ->assertSession()
    ->statusCodeEquals($expected_status_code);
}