You are here

public function LayoutBuilderAccessTest::providerTestAccessWithoutBundles 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::providerTestAccessWithoutBundles()
  2. 10 core/modules/layout_builder/tests/src/Functional/LayoutBuilderAccessTest.php \Drupal\Tests\layout_builder\Functional\LayoutBuilderAccessTest::providerTestAccessWithoutBundles()

Provides test data for ::testAccessWithoutBundles().

File

core/modules/layout_builder/tests/src/Functional/LayoutBuilderAccessTest.php, line 237

Class

LayoutBuilderAccessTest
Tests access to Layout Builder.

Namespace

Drupal\Tests\layout_builder\Functional

Code

public function providerTestAccessWithoutBundles() {

  // Data provider values are:
  // - the permissions to grant to the user
  // - whether access is expected for the defaults
  // - whether access is expected for a non-editable override
  // - whether access is expected for an editable override.
  $data = [];
  $data['configure any layout'] = [
    [
      'configure any layout',
      'administer user display',
    ],
    TRUE,
    TRUE,
    TRUE,
    [],
  ];
  $data['override permissions'] = [
    [
      'configure all user user layout overrides',
    ],
    FALSE,
    TRUE,
    TRUE,
    [
      'configure all user user layout overrides' => [
        'config' => [
          'core.entity_view_display.user.user.default',
        ],
      ],
    ],
  ];
  $data['editable override permissions'] = [
    [
      'configure editable user user layout overrides',
    ],
    FALSE,
    FALSE,
    TRUE,
    [
      'configure all user user layout overrides' => [
        'config' => [
          'core.entity_view_display.user.user.default',
        ],
      ],
    ],
  ];
  return $data;
}