You are here

public function AccessByUserFormTest::testAccessByUserFormMenu in Workbench Access 8

Tests that the correct users are displayed on the access by user form.

File

tests/src/Functional/AccessByUserFormTest.php, line 64

Class

AccessByUserFormTest
Tests for the access by user form.

Namespace

Drupal\Tests\workbench_access\Functional

Code

public function testAccessByUserFormMenu() {

  // Set up test scheme.
  $node_type = $this
    ->createContentType([
    'type' => 'page',
  ]);
  $scheme = $this
    ->setUpMenuScheme([
    $node_type
      ->id(),
  ], [
    'main',
  ]);

  // Create a menu link.
  $link = MenuLinkContent::create([
    'title' => 'Home',
    'link' => [
      [
        'uri' => 'route:<front>',
      ],
    ],
    'menu_name' => 'main',
  ]);
  $link
    ->save();
  $section_id = $link
    ->id();
  $this
    ->doFormTests($scheme, $section_id, 'Home');
}