You are here

public function AccessByRoleFormTest::testAccessByRoleForm in Workbench Access 8

Tests that the correct roles are displayed on the access by role form.

File

tests/src/Functional/AccessByRoleFormTest.php, line 45

Class

AccessByRoleFormTest
Tests for the access by role form.

Namespace

Drupal\Tests\workbench_access\Functional

Code

public function testAccessByRoleForm() {

  // Set up a content type, taxonomy field, and taxonomy scheme.
  $node_type = $this
    ->createContentType([
    'type' => 'page',
  ]);
  $vocab = $this
    ->setUpVocabulary();
  $this
    ->setUpTaxonomyFieldForEntityType('node', $node_type
    ->id(), $vocab
    ->id());
  $scheme = $this
    ->setUpTaxonomyScheme($node_type, $vocab);

  // Set up some roles and terms for this test.
  // Create terms and roles.
  $staff_term = Term::create([
    'vid' => $vocab
      ->id(),
    'name' => 'Staff',
  ]);
  $staff_term
    ->save();
  $section_id = $staff_term
    ->id();
  $this
    ->doFormTests($scheme, $section_id);
}